mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +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]);
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ const DeliveryOrderProductTable = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
<tr className='border-b border-t border-tools-table-outline border-base-content/5'>
|
||||
<tr className='border-b border-tools-table-outline border-base-content/5'>
|
||||
<th className='w-1/3 text-start not-first:font-medium text-base-content/50 text-sm px-4 py-3'>
|
||||
Label
|
||||
</th>
|
||||
|
||||
Reference in New Issue
Block a user