mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-17 01:32:45 +00:00
Remove error handling that can never trigger
This commit is contained in:
@@ -72,17 +72,7 @@ router.post('/admin/cleanup', mw.adminOnly, (req, res)=>{
|
|||||||
/* Searches for matching edit or share id, also attempts to partial match */
|
/* Searches for matching edit or share id, also attempts to partial match */
|
||||||
router.get('/admin/lookup/:id', mw.adminOnly, asyncHandler(HomebrewAPI.getBrew('admin', false)), async (req, res, next)=>{
|
router.get('/admin/lookup/:id', mw.adminOnly, asyncHandler(HomebrewAPI.getBrew('admin', false)), async (req, res, next)=>{
|
||||||
const brew = req?.brew ?? undefined;
|
const brew = req?.brew ?? undefined;
|
||||||
|
return res.json(brew);
|
||||||
try {
|
|
||||||
if(!brew){
|
|
||||||
// No document found
|
|
||||||
return res.status(404).json({ error: 'Document not found' });
|
|
||||||
}
|
|
||||||
return res.json(brew);
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
return res.status(500).json({ error: 'Internal Server Error' });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/* Find 50 brews that aren't compressed yet */
|
/* Find 50 brews that aren't compressed yet */
|
||||||
|
|||||||
Reference in New Issue
Block a user