0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 20:42:43 +00:00

Enable brew version mismatch checking on server

Was commented out previously to allow users time to update client code so the proper error displays
This commit is contained in:
Trevor Buckner
2023-01-09 10:30:07 -05:00
committed by Victor Losada Hernandez
parent 3538aa6da0
commit 01b03e8683

View File

@@ -192,8 +192,8 @@ If you believe you should have access to this brew, ask the file owner to invite
const brewFromClient = api.excludePropsFromUpdate(req.body);
if(req.brew.version && brewFromClient.version && req.brew.version > brewFromClient.version) {
console.log(`Version mismatch on brew ${req.body.editId}`);
// res.setHeader('Content-Type', 'application/json');
// return res.status(409).send(JSON.stringify({ message: `The brew has been changed on a different device. Please save your changes elsewhere, refresh, and try again.` }));
res.setHeader('Content-Type', 'application/json');
return res.status(409).send(JSON.stringify({ message: `The brew has been changed on a different device. Please save your changes elsewhere, refresh, and try again.` }));
}
let brew = _.assign(req.brew, brewFromClient);