category compelete

This commit is contained in:
hamid zarghami
2025-11-15 16:18:29 +03:30
parent 8900e85892
commit 322120635d
8 changed files with 374 additions and 167 deletions
+19
View File
@@ -1,5 +1,6 @@
import axios from "@/config/axios";
import type {
CreateCategoryType,
CreateFoodType,
GetCategoriesResponseType,
GetFoodDetailsResponseType,
@@ -40,3 +41,21 @@ export const deleteFood = async (id: string) => {
const { data } = await axios.delete(`/foods/${id}`);
return data;
};
export const createCategory = async (params: CreateCategoryType) => {
const { data } = await axios.post(`/categories`, params);
return data;
};
export const deleteCategory = async (id: string) => {
const { data } = await axios.delete(`/categories/${id}`);
return data;
};
export const updateCategory = async (
id: string,
params: CreateCategoryType
) => {
const { data } = await axios.patch(`/categories/${id}`, params);
return data;
};