diff --git a/src/components/purchase/ManagePurchase.jsx b/src/components/purchase/ManagePurchase.jsx index 82a1940f..7120842f 100644 --- a/src/components/purchase/ManagePurchase.jsx +++ b/src/components/purchase/ManagePurchase.jsx @@ -41,6 +41,7 @@ const ManagePurchase = ({ onClose }) => { defaultValues: defaultPurchaseValue, mode: "onChange", }); + const {reset} = purchaseOrder; const handleNext = async () => { const currentStepFields = getStepFields(activeTab); @@ -57,11 +58,11 @@ const ManagePurchase = ({ onClose }) => { }; const { mutate: CreateInvoice, isPending } = useCreatePurchaseInvoice(() => { - onClose?.(); + reset() + onClose(); }); const onSubmit = (formData) => { - console.log("PURCHASE DATA:", formData); let payload = formData; CreateInvoice(payload); }; diff --git a/src/components/purchase/PurchasePaymentDetails.jsx b/src/components/purchase/PurchasePaymentDetails.jsx index 6cfaa6c3..edaf4883 100644 --- a/src/components/purchase/PurchasePaymentDetails.jsx +++ b/src/components/purchase/PurchasePaymentDetails.jsx @@ -6,7 +6,6 @@ import { useInvoiceAttachmentTypes } from "../../hooks/masterHook/useMaster"; const PurchasePaymentDetails = () => { const { data, isLoading, error, isError } = useInvoiceAttachmentTypes(); - console.log(data); const { register, watch, diff --git a/src/hooks/usePurchase.jsx b/src/hooks/usePurchase.jsx index 749e720d..88f4d9cc 100644 --- a/src/hooks/usePurchase.jsx +++ b/src/hooks/usePurchase.jsx @@ -1,5 +1,6 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import { PurchaseRepository } from "../repositories/PurchaseRepository"; +import showToast from "../services/toastService"; diff --git a/src/pages/purchase/PurchasePage.jsx b/src/pages/purchase/PurchasePage.jsx index 706c4a9b..6a3e508d 100644 --- a/src/pages/purchase/PurchasePage.jsx +++ b/src/pages/purchase/PurchasePage.jsx @@ -47,7 +47,7 @@ const PurchasePage = () => { size="lg" closeModal={() => setAddedPurchase(false)} > - () => setAddedPurchase(false)} /> + setAddedPurchase(false)} />