mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-05 18:52:38 +00:00
Add return on success to lock route
This commit is contained in:
@@ -182,9 +182,12 @@ router.post('/admin/lock/:id', mw.adminOnly, async (req, res)=>{
|
|||||||
await brew.save();
|
await brew.save();
|
||||||
|
|
||||||
console.log(`Lock applied to brew ID ${brew.shareId} - ${brew.title}`);
|
console.log(`Lock applied to brew ID ${brew.shareId} - ${brew.title}`);
|
||||||
} catch {}
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
return res.status(500).json({ error: `Unable to set lock on brew ${req.params.id}` });
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return res.status(200).json({ status: 'SUCCESS', lock });
|
||||||
});
|
});
|
||||||
|
|
||||||
router.get('/admin/lock/reviews', mw.adminOnly, async (req, res)=>{
|
router.get('/admin/lock/reviews', mw.adminOnly, async (req, res)=>{
|
||||||
|
|||||||
Reference in New Issue
Block a user