cancel reason

This commit is contained in:
hamid zarghami
2025-10-08 11:43:48 +03:30
parent bc9aac7fc4
commit 30c4ab91fb
5 changed files with 192 additions and 52 deletions
+19
View File
@@ -1,5 +1,7 @@
import axios from "../../../config/axios";
import type {
CancelReasonsResponseType,
CreateCancelReasonType,
NativeOrdersResponseType,
OrderDetailResponseType,
} from "../types/Types";
@@ -30,3 +32,20 @@ export const getOrderDetailUser = async (
const { data } = await axios.get(`/admin/orders/${id}/user`);
return data;
};
export const createCancelReason = async (params: CreateCancelReasonType) => {
const { data } = await axios.post(`/admin/orders/cancel/reasons`, params);
return data;
};
export const getCancelReasons = async (): Promise<
CancelReasonsResponseType
> => {
const { data } = await axios.get(`/cancel/reasons`);
return data;
};
export const deleteCancelReason = async (id: string) => {
const { data } = await axios.delete(`/cancel/reasons/${id}`);
return data;
};