category compelete
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user