reset after invoice created
This commit is contained in:
parent
998284f398
commit
80f5dbd639
@ -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);
|
||||
};
|
||||
|
||||
@ -6,7 +6,6 @@ import { useInvoiceAttachmentTypes } from "../../hooks/masterHook/useMaster";
|
||||
|
||||
const PurchasePaymentDetails = () => {
|
||||
const { data, isLoading, error, isError } = useInvoiceAttachmentTypes();
|
||||
console.log(data);
|
||||
const {
|
||||
register,
|
||||
watch,
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { PurchaseRepository } from "../repositories/PurchaseRepository";
|
||||
import showToast from "../services/toastService";
|
||||
|
||||
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ const PurchasePage = () => {
|
||||
size="lg"
|
||||
closeModal={() => setAddedPurchase(false)}
|
||||
>
|
||||
<ManagePurchase onClose={() => () => setAddedPurchase(false)} />
|
||||
<ManagePurchase onClose={() => setAddedPurchase(false)} />
|
||||
</GlobalModel>
|
||||
</div>
|
||||
</PurchaseContext.Provider>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user