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
+20 -1
View File
@@ -1,4 +1,4 @@
import { useQuery } from "@tanstack/react-query";
import { useMutation, useQuery } from "@tanstack/react-query";
import * as api from "../service/OrderService";
export const useGetNativeOrders = (
@@ -30,3 +30,22 @@ export const useGetOrderDetailUser = (id: string) => {
enabled: !!id,
});
};
export const useCreateCancelReason = () => {
return useMutation({
mutationFn: api.createCancelReason,
});
};
export const useGetCancelReasons = () => {
return useQuery({
queryKey: ["cancel-reasons"],
queryFn: api.getCancelReasons,
});
};
export const useDeleteCancelReason = () => {
return useMutation({
mutationFn: api.deleteCancelReason,
});
};