From 4b7396c210a0130e5c65cd3eb90ff8e3fad9f21c Mon Sep 17 00:00:00 2001 From: LandaMm Date: Tue, 3 Jun 2025 00:05:32 +0200 Subject: [PATCH] feat: toggle api service API --- web/src/api/admin/apiServices.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/web/src/api/admin/apiServices.ts b/web/src/api/admin/apiServices.ts index 8db2d2f..452d731 100644 --- a/web/src/api/admin/apiServices.ts +++ b/web/src/api/admin/apiServices.ts @@ -55,3 +55,12 @@ export const getApiService = async (id: string): Promise => { return response.data; }; + +export const patchToggleApiService = async (id: string): Promise => { + const response = await axios.patch(`/api/v1/admin/api-services/toggle/${id}`); + + if (response.status !== 200 && response.status !== 201) + throw await handleApiError(response); + + return response.data; +};