cancel reason
This commit is contained in:
@@ -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,
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user