19 lines
484 B
TypeScript
19 lines
484 B
TypeScript
import type { ApiService } from "@/types";
|
|
import { axios, handleApiError } from "..";
|
|
|
|
export interface FetchApiServicesResponse {
|
|
items: ApiService[];
|
|
count: number;
|
|
}
|
|
|
|
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;
|
|
};
|