0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-25 16:12:37 +00:00

Log message when review already requested

This commit is contained in:
G.Ambatte
2024-04-25 14:33:29 +12:00
parent 99f5aad942
commit 71b84e1aba

View File

@@ -196,7 +196,10 @@ router.get('/admin/lock/requestreview/:id', mw.adminOnly, async (req, res)=>{
const brew = await HomebrewModel.findOne(filter);
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.markModified('lock');