0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 22:52:40 +00:00

Base savedBrew on current brew state, apply only updated properties from API call

This commit is contained in:
G.Ambatte
2025-02-15 00:12:20 +13:00
parent 557178172b
commit 34a0b4eb05

View File

@@ -247,7 +247,13 @@ const EditPage = createClass({
});
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}`);
this.setState((prevState)=>({