mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 15:25:46 +00:00
refactor(FE): Fix form reset and selection handling in
SalesOrderFormModal
This commit is contained in:
@@ -394,7 +394,7 @@ const SalesOrderFormModal = ({
|
||||
}
|
||||
|
||||
formik.setFieldValue('sales_order', updatedProducts);
|
||||
console.log(formik.values);
|
||||
setSelectedMarketingProduct(null);
|
||||
nextButtonHandler();
|
||||
},
|
||||
[memoSalesOrder, nextButtonHandler]
|
||||
@@ -418,6 +418,15 @@ const SalesOrderFormModal = ({
|
||||
if (modalAction === 'add' || modalAction === 'edit') {
|
||||
setCurrentModalAction(modalAction);
|
||||
formModal.openModal();
|
||||
|
||||
if (modalAction === 'add') {
|
||||
formik.resetForm();
|
||||
setStep(1);
|
||||
setSelectedMarketingProduct(null);
|
||||
setSelectedDeliveryProduct(null);
|
||||
setFormErrorMessage('');
|
||||
setFormErrorList([]);
|
||||
}
|
||||
}
|
||||
}, [modalAction]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user