0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-01 02:02:43 +00:00

Add to /new page

This commit is contained in:
Trevor Buckner
2024-07-23 16:43:23 -04:00
parent 24ab3d3392
commit 22b6aa14f0
5 changed files with 36 additions and 10 deletions

View File

@@ -286,7 +286,7 @@ app.get('/edit/:id', asyncHandler(getBrew('edit')), asyncHandler(async(req, res,
return next();
}));
//New Page
//New Page from ID
app.get('/new/:id', asyncHandler(getBrew('share')), asyncHandler(async(req, res, next)=>{
sanitizeBrew(req.brew, 'share');
splitTextStyleAndMetadata(req.brew);
@@ -311,6 +311,18 @@ app.get('/new/:id', asyncHandler(getBrew('share')), asyncHandler(async(req, res,
return next();
}));
//New Page
app.get('/new', asyncHandler(async(req, res, next)=>{
req.userThemes = await(getUsersBrewThemes(req.account?.username));
req.ogMeta = { ...defaultMetaTags,
title : 'New',
description : 'Start crafting your homebrew on the Homebrewery!'
};
return next();
}));
//Share Page
app.get('/share/:id', asyncHandler(getBrew('share')), asyncHandler(async (req, res, next)=>{
const { brew } = req;