From d7ea161fab4e88808875d9ab4ae3cf1c728a19f5 Mon Sep 17 00:00:00 2001 From: mgtennant <100305096+mgtennant@users.noreply.github.com> Date: Fri, 6 Sep 2024 16:28:19 -0700 Subject: [PATCH] fix issue with add provision modal clearing --- .../modal/manage-provisions/AddProvisionModal.tsx | 14 ++++++++++---- .../forms/EditProvisionModalForm.tsx | 1 - 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/components/modal/manage-provisions/AddProvisionModal.tsx b/frontend/src/app/components/modal/manage-provisions/AddProvisionModal.tsx index 66e11275..dbb06957 100644 --- a/frontend/src/app/components/modal/manage-provisions/AddProvisionModal.tsx +++ b/frontend/src/app/components/modal/manage-provisions/AddProvisionModal.tsx @@ -69,7 +69,7 @@ const AddProvisionModal: React.FC = ({ show, addProvisio }; await addProvisionHandler(provisionUpload); - onHide(); + handleOnHide(); } catch (err) { console.log('Error adding provision'); console.log(err); @@ -78,13 +78,19 @@ const AddProvisionModal: React.FC = ({ show, addProvisio } }; + const handleOnHide = () => { + onHide(); + setListEnabled(false); + setListItems(['']); + }; + return ( - + Add Provision diff --git a/frontend/src/app/components/modal/manage-provisions/forms/EditProvisionModalForm.tsx b/frontend/src/app/components/modal/manage-provisions/forms/EditProvisionModalForm.tsx index 3a653107..55bb1343 100644 --- a/frontend/src/app/components/modal/manage-provisions/forms/EditProvisionModalForm.tsx +++ b/frontend/src/app/components/modal/manage-provisions/forms/EditProvisionModalForm.tsx @@ -94,7 +94,6 @@ const EditProvisionModalForm: React.FC = ({ help_text: helpText, category: category, }; - console.log(provisionUpload); updateProvisionHandler(provisionUpload, provision.id); } };