reset after invoice created
This commit is contained in:
parent
998284f398
commit
80f5dbd639
@ -41,6 +41,7 @@ const ManagePurchase = ({ onClose }) => {
|
|||||||
defaultValues: defaultPurchaseValue,
|
defaultValues: defaultPurchaseValue,
|
||||||
mode: "onChange",
|
mode: "onChange",
|
||||||
});
|
});
|
||||||
|
const {reset} = purchaseOrder;
|
||||||
|
|
||||||
const handleNext = async () => {
|
const handleNext = async () => {
|
||||||
const currentStepFields = getStepFields(activeTab);
|
const currentStepFields = getStepFields(activeTab);
|
||||||
@ -57,11 +58,11 @@ const ManagePurchase = ({ onClose }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const { mutate: CreateInvoice, isPending } = useCreatePurchaseInvoice(() => {
|
const { mutate: CreateInvoice, isPending } = useCreatePurchaseInvoice(() => {
|
||||||
onClose?.();
|
reset()
|
||||||
|
onClose();
|
||||||
});
|
});
|
||||||
|
|
||||||
const onSubmit = (formData) => {
|
const onSubmit = (formData) => {
|
||||||
console.log("PURCHASE DATA:", formData);
|
|
||||||
let payload = formData;
|
let payload = formData;
|
||||||
CreateInvoice(payload);
|
CreateInvoice(payload);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import { useInvoiceAttachmentTypes } from "../../hooks/masterHook/useMaster";
|
|||||||
|
|
||||||
const PurchasePaymentDetails = () => {
|
const PurchasePaymentDetails = () => {
|
||||||
const { data, isLoading, error, isError } = useInvoiceAttachmentTypes();
|
const { data, isLoading, error, isError } = useInvoiceAttachmentTypes();
|
||||||
console.log(data);
|
|
||||||
const {
|
const {
|
||||||
register,
|
register,
|
||||||
watch,
|
watch,
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||||
import { PurchaseRepository } from "../repositories/PurchaseRepository";
|
import { PurchaseRepository } from "../repositories/PurchaseRepository";
|
||||||
|
import showToast from "../services/toastService";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ const PurchasePage = () => {
|
|||||||
size="lg"
|
size="lg"
|
||||||
closeModal={() => setAddedPurchase(false)}
|
closeModal={() => setAddedPurchase(false)}
|
||||||
>
|
>
|
||||||
<ManagePurchase onClose={() => () => setAddedPurchase(false)} />
|
<ManagePurchase onClose={() => setAddedPurchase(false)} />
|
||||||
</GlobalModel>
|
</GlobalModel>
|
||||||
</div>
|
</div>
|
||||||
</PurchaseContext.Provider>
|
</PurchaseContext.Provider>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user