Move currentBrew/lastSavedBrew update after saving to common hook

This commit is contained in:
Trevor Buckner
2026-10-05 18:06:02 +00:00
parent c5e9e2f8e1
commit 766fc73dbc
4 changed files with 20 additions and 29 deletions
+3 -13
View File
@@ -103,23 +103,13 @@ const EditPage = (props)=>{
if(!res) return;
const updatedFields = {
googleId : res.body.googleId ?? null,
editId : res.body.editId,
googleId : res.body.googleId ?? null, //TODO: investigate if we can set googleId:null in server/update instead of undefined
editId : res.body.editId, //then, editPage can just apply res.body instead of breaking out these fields.
shareId : res.body.shareId,
version : res.body.version
};
lastSavedBrew.current = {
...brew,
...updatedFields
};
setCurrentBrew((prevBrew)=>({
...prevBrew,
...updatedFields
}));
return res.body;
return updatedFields;
};
const onSaveSuccess = (savedBrew)=>{