Remove storage "save and edit next"

This commit is contained in:
Tanner Collin 2023-08-20 03:43:58 +00:00
parent c713b7e3e1
commit 7e588170f6

View File

@ -47,7 +47,6 @@ function EditStorage(props) {
const [loading, setLoading] = useState(false);
const [success, setSuccess] = useState(false);
const { id } = useParams();
const history = useHistory();
const handleSubmit = (e) => {
if (loading) return;
@ -69,25 +68,11 @@ function EditStorage(props) {
});
};
const saveAndNext = (e) => {
e.preventDefault();
handleSubmit(e)
.then(res => {
setStorage(false);
history.push('/storage/' + (parseInt(id) + 1));
});
};
return (
<div>
<Header size='medium'>Edit Storage {storage.shelf_id}</Header>
<Form onSubmit={handleSubmit}>
<Form.Button floated='right' onClick={saveAndNext} loading={loading} error={error.non_field_errors}>
Save and edit next
</Form.Button>
<StorageEditor token={token} input={input} setInput={setInput} error={error} />
<Form.Group widths='equal'>