mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-16 01:42:47 +00:00
Log version mismatch errors
To gauge how frequently they are occurring for future update.
This commit is contained in:
@@ -193,10 +193,11 @@ const newBrew = async (req, res)=>{
|
|||||||
const updateBrew = async (req, res)=>{
|
const updateBrew = async (req, res)=>{
|
||||||
// Initialize brew from request and body, destructure query params, set a constant for the google id, and set the initial value for the after-save method
|
// Initialize brew from request and body, destructure query params, set a constant for the google id, and set the initial value for the after-save method
|
||||||
const brewFromClient = excludePropsFromUpdate(req.body);
|
const brewFromClient = excludePropsFromUpdate(req.body);
|
||||||
//if(req.brew.version && brewFromClient.version && req.brew.version > brewFromClient.version) {
|
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');
|
// 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.` }));
|
// 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);
|
let brew = _.assign(req.brew, brewFromClient);
|
||||||
const { saveToGoogle, removeFromGoogle } = req.query;
|
const { saveToGoogle, removeFromGoogle } = req.query;
|
||||||
|
|||||||
Reference in New Issue
Block a user