feat: update api service API
This commit is contained in:
@ -64,3 +64,28 @@ export const patchToggleApiService = async (id: string): Promise<void> => {
|
|||||||
|
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export interface UpdateApiServiceRequest {
|
||||||
|
name: string;
|
||||||
|
description: string;
|
||||||
|
redirect_uris: string[];
|
||||||
|
scopes: string[];
|
||||||
|
grant_types: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UpdateApiServiceResponse = ApiService;
|
||||||
|
|
||||||
|
export const putApiService = async (
|
||||||
|
serviceId: string,
|
||||||
|
req: UpdateApiServiceRequest,
|
||||||
|
): Promise<UpdateApiServiceResponse> => {
|
||||||
|
const response = await axios.put<UpdateApiServiceResponse>(
|
||||||
|
`/api/v1/admin/api-services/${serviceId}`,
|
||||||
|
req,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (response.status !== 200 && response.status !== 201)
|
||||||
|
throw await handleApiError(response);
|
||||||
|
|
||||||
|
return response.data;
|
||||||
|
};
|
||||||
|
Reference in New Issue
Block a user