edit order
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||
import * as api from "../service/OrderService";
|
||||
import type { AddTicketType } from "../types/Types";
|
||||
import type { AddTicketType, CreateFinalOrderType } from "../types/Types";
|
||||
|
||||
export const useGetOrders = () => {
|
||||
return useQuery({
|
||||
@@ -43,6 +43,18 @@ export const useCreateOrder = () => {
|
||||
});
|
||||
};
|
||||
|
||||
export const useUpdateOrder = () => {
|
||||
return useMutation({
|
||||
mutationFn: ({
|
||||
orderId,
|
||||
params,
|
||||
}: {
|
||||
orderId: string;
|
||||
params: CreateFinalOrderType;
|
||||
}) => api.updateOrder(orderId, params),
|
||||
});
|
||||
};
|
||||
|
||||
export const useGetProducts = () => {
|
||||
return useQuery({
|
||||
queryKey: ["products"],
|
||||
|
||||
Reference in New Issue
Block a user