design invoice
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import * as api from "../service/InvoiceService";
|
||||
import type { CreatePreInvoiceType } from "../types/Types";
|
||||
|
||||
export const useCreatePreInvoice = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation({
|
||||
mutationFn: (params: CreatePreInvoiceType) => api.createPreInvoice(params),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ["orders-invoiced"] });
|
||||
},
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user