create print form

This commit is contained in:
hamid zarghami
2026-02-02 15:53:28 +03:30
parent 024cd19b82
commit 48136a9f15
6 changed files with 253 additions and 1 deletions
+23 -1
View File
@@ -1,6 +1,6 @@
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import * as api from "../service/PrintService";
import type { CreateSectionType } from "../types/Types";
import type { CreatePrintFormType, CreateSectionType } from "../types/Types";
export const useGetSections = () => {
return useQuery({
@@ -55,3 +55,25 @@ export const useDeleteSection = () => {
},
});
};
export const useCreatePrintForm = () => {
return useMutation({
mutationFn: ({
orderId,
itemId,
params,
}: {
orderId: string;
itemId: number;
params: CreatePrintFormType;
}) => api.createPrintForm(orderId, itemId, params),
// onSuccess: (_, params) => {
// queryClient.refetchQueries({
// queryKey: ["sections"],
// });
// queryClient.refetchQueries({
// queryKey: ["section", params.id],
// });
// },
});
};