crud discount admin
This commit is contained in:
@@ -15,3 +15,21 @@ export const toggleStatusDiscount = async (id: string) => {
|
||||
const { data } = await axios.patch(`/discounts/${id}/toggle`);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const getDiscountDetail = async (id: string) => {
|
||||
const { data } = await axios.get(`/discounts/${id}`);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const updateDiscount = async (
|
||||
id: string,
|
||||
params: CreateDiscountType
|
||||
) => {
|
||||
const { data } = await axios.patch(`/discounts/${id}`, params);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const deleteDiscount = async (id: string) => {
|
||||
const { data } = await axios.delete(`/discounts/${id}`);
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user