feat: api for fetching api services
This commit is contained in:
@ -1,8 +1,18 @@
|
|||||||
import { axios } from ".."
|
import type { ApiService } from "@/types";
|
||||||
|
import { axios, handleApiError } from "..";
|
||||||
|
|
||||||
|
export interface FetchApiServicesResponse {
|
||||||
export interface FetchApiServicesRequest {}
|
items: ApiService[];
|
||||||
|
count: number;
|
||||||
export const fetchApiServices = async (req: FetchApiServicesRequest) => {
|
|
||||||
const response = await axios.get()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getApiServices = async (): Promise<FetchApiServicesResponse> => {
|
||||||
|
const response = await axios.get<FetchApiServicesResponse>(
|
||||||
|
"/api/v1/admin/api-services",
|
||||||
|
);
|
||||||
|
|
||||||
|
if (response.status !== 200 && response.status !== 201)
|
||||||
|
throw await handleApiError(response);
|
||||||
|
|
||||||
|
return response.data;
|
||||||
|
};
|
||||||
|
Reference in New Issue
Block a user