delete catalog
This commit is contained in:
@@ -8,6 +8,12 @@ export const useCreateCatalog = () => {
|
||||
});
|
||||
};
|
||||
|
||||
export const useDleteCatalog = () => {
|
||||
return useMutation({
|
||||
mutationFn: (id: string) => api.deleteCatalogById(id),
|
||||
});
|
||||
};
|
||||
|
||||
export const useGetCatalog = () => {
|
||||
return useQuery({
|
||||
queryKey: ["catalogs"],
|
||||
|
||||
@@ -31,3 +31,8 @@ export const updateCatalog = async (params: UpdateCatalogParamsType) => {
|
||||
});
|
||||
return data;
|
||||
};
|
||||
|
||||
export const deleteCatalogById = async (id: string) => {
|
||||
const { data } = await axios.delete(`/admin/catalogue/${id}`);
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user