delete catalog

This commit is contained in:
hamid zarghami
2026-03-14 16:27:40 +03:30
parent f4f617f8d2
commit 18b9bf820f
6 changed files with 50 additions and 13 deletions
+6
View File
@@ -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"],
+5
View File
@@ -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;
};