Remove storage "save and edit next"
This commit is contained in:
parent
c713b7e3e1
commit
7e588170f6
|
@ -47,7 +47,6 @@ function EditStorage(props) {
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [success, setSuccess] = useState(false);
|
const [success, setSuccess] = useState(false);
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
const history = useHistory();
|
|
||||||
|
|
||||||
const handleSubmit = (e) => {
|
const handleSubmit = (e) => {
|
||||||
if (loading) return;
|
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 (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Header size='medium'>Edit Storage {storage.shelf_id}</Header>
|
<Header size='medium'>Edit Storage {storage.shelf_id}</Header>
|
||||||
|
|
||||||
<Form onSubmit={handleSubmit}>
|
<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} />
|
<StorageEditor token={token} input={input} setInput={setInput} error={error} />
|
||||||
|
|
||||||
<Form.Group widths='equal'>
|
<Form.Group widths='equal'>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user