mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-05 10:12:41 +00:00
Base savedBrew on current brew state, apply only updated properties from API call
This commit is contained in:
@@ -247,7 +247,13 @@ const EditPage = createClass({
|
|||||||
});
|
});
|
||||||
if(!res) return;
|
if(!res) return;
|
||||||
|
|
||||||
this.savedBrew = res.body;
|
this.savedBrew = {
|
||||||
|
...this.state.brew,
|
||||||
|
googleId : res.body.googleId ? res.body.googleId : null,
|
||||||
|
editId : res.body.editId,
|
||||||
|
shareId : res.body.shareId,
|
||||||
|
version : res.body.version
|
||||||
|
};
|
||||||
history.replaceState(null, null, `/edit/${this.savedBrew.editId}`);
|
history.replaceState(null, null, `/edit/${this.savedBrew.editId}`);
|
||||||
|
|
||||||
this.setState((prevState)=>({
|
this.setState((prevState)=>({
|
||||||
|
|||||||
Reference in New Issue
Block a user