Skip to content

Commit

Permalink
fix issue with add provision modal clearing
Browse files Browse the repository at this point in the history
  • Loading branch information
mgtennant committed Sep 6, 2024
1 parent a3ff90d commit d7ea161
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const AddProvisionModal: React.FC<AddProvisionModalProps> = ({ show, addProvisio
};

await addProvisionHandler(provisionUpload);
onHide();
handleOnHide();
} catch (err) {
console.log('Error adding provision');
console.log(err);
Expand All @@ -78,13 +78,19 @@ const AddProvisionModal: React.FC<AddProvisionModalProps> = ({ show, addProvisio
}
};

const handleOnHide = () => {
onHide();
setListEnabled(false);
setListItems(['']);
};

return (
<Modal show={show} onHide={onHide} size="lg">
<Modal show={show} onHide={handleOnHide} size="lg">
<Modal.Header>
<Modal.Title>Add Provision</Modal.Title>
<Button
variant="none"
onClick={onHide}
onClick={handleOnHide}
style={{
marginLeft: 'auto',
border: 'none',
Expand Down Expand Up @@ -176,7 +182,7 @@ const AddProvisionModal: React.FC<AddProvisionModalProps> = ({ show, addProvisio
</Form>
</Modal.Body>
<Modal.Footer>
<Button variant="secondary" onClick={onHide}>
<Button variant="secondary" onClick={handleOnHide}>
Cancel
</Button>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ const EditProvisionModalForm: React.FC<EditProvisionModalFormProps> = ({
help_text: helpText,
category: category,
};
console.log(provisionUpload);
updateProvisionHandler(provisionUpload, provision.id);
}
};
Expand Down

0 comments on commit d7ea161

Please sign in to comment.