mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-06 23:02:45 +00:00
Log message when review already requested
This commit is contained in:
@@ -196,7 +196,10 @@ router.get('/admin/lock/requestreview/:id', mw.adminOnly, async (req, res)=>{
|
|||||||
const brew = await HomebrewModel.findOne(filter);
|
const brew = await HomebrewModel.findOne(filter);
|
||||||
if(!brew) { return res.status(500).json({ error: `Brew ID ${req.params.id} is not locked!` }); };
|
if(!brew) { return res.status(500).json({ error: `Brew ID ${req.params.id} is not locked!` }); };
|
||||||
|
|
||||||
if(brew.lock.reviewRequested){ return res.status(500).json({ error: `Review already requested for brew ${brew.shareId} - ${brew.title}` }); };
|
if(brew.lock.reviewRequested){
|
||||||
|
console.log(`Review already requested for brew ${brew.shareId} - ${brew.title}`);
|
||||||
|
return res.status(500).json({ error: `Review already requested for brew ${brew.shareId} - ${brew.title}` });
|
||||||
|
};
|
||||||
|
|
||||||
brew.lock.reviewRequested = new Date();
|
brew.lock.reviewRequested = new Date();
|
||||||
brew.markModified('lock');
|
brew.markModified('lock');
|
||||||
|
|||||||
Reference in New Issue
Block a user