1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-01 01:18:10 +02:00
unleash.unleash/frontend/src/hooks/api/actions/useReleasePlanTemplatesApi/useReleasePlanTemplatesApi.ts
2024-11-06 15:55:26 +01:00

24 lines
601 B
TypeScript

import useAPI from '../useApi/useApi';
export const useReleasePlanTemplatesApi = () => {
const { makeRequest, makeLightRequest, createRequest, errors, loading } =
useAPI({
propagateErrors: true,
});
const deleteReleasePlanTemplate = async (id: string) => {
const path = `api/admin/release-plan-templates/${id}`;
const req = createRequest(path, {
method: 'DELETE',
});
return makeRequest(req.caller, req.id);
};
return {
deleteReleasePlanTemplate,
};
};
export default useReleasePlanTemplatesApi;