mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-08 14:02:41 +00:00
Lint App.js
Just whitespace changes
This commit is contained in:
@@ -203,17 +203,17 @@ app.get('/download/:id', asyncHandler(getBrew('share')), (req, res)=>{
|
|||||||
});
|
});
|
||||||
|
|
||||||
//Serve brew metadata
|
//Serve brew metadata
|
||||||
app.get('/metadata/:id', asyncHandler(getBrew('share')), (req, res) => {
|
app.get('/metadata/:id', asyncHandler(getBrew('share')), (req, res)=>{
|
||||||
const { brew } = req;
|
const { brew } = req;
|
||||||
sanitizeBrew(brew, 'share');
|
sanitizeBrew(brew, 'share');
|
||||||
|
|
||||||
const fields = [ 'title', 'pageCount', 'description', 'authors', 'lang',
|
const fields = ['title', 'pageCount', 'description', 'authors', 'lang',
|
||||||
'published', 'views', 'shareId', 'createdAt', 'updatedAt',
|
'published', 'views', 'shareId', 'createdAt', 'updatedAt',
|
||||||
'lastViewed', 'thumbnail', 'tags'
|
'lastViewed', 'thumbnail', 'tags'
|
||||||
];
|
];
|
||||||
|
|
||||||
const metadata = fields.reduce((acc, field) => {
|
const metadata = fields.reduce((acc, field)=>{
|
||||||
if (brew[field] !== undefined) acc[field] = brew[field];
|
if(brew[field] !== undefined) acc[field] = brew[field];
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
res.status(200).json(metadata);
|
res.status(200).json(metadata);
|
||||||
@@ -462,7 +462,7 @@ app.get('/vault', asyncHandler(async(req, res, next)=>{
|
|||||||
|
|
||||||
//Send rendered page
|
//Send rendered page
|
||||||
app.use(asyncHandler(async (req, res, next)=>{
|
app.use(asyncHandler(async (req, res, next)=>{
|
||||||
if (!req.route) return res.redirect('/'); // Catch-all for invalid routes
|
if(!req.route) return res.redirect('/'); // Catch-all for invalid routes
|
||||||
|
|
||||||
const page = await renderPage(req, res);
|
const page = await renderPage(req, res);
|
||||||
if(!page) return;
|
if(!page) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user