0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-30 11:02:38 +00:00

prop drilling

This commit is contained in:
Víctor Losada Hernández
2025-05-11 23:59:04 +02:00
parent 9e78671e4f
commit 91f7d86fd4
4 changed files with 6 additions and 3 deletions

View File

@@ -378,7 +378,7 @@ app.get('/edit/:id', asyncHandler(getBrew('edit')), asyncHandler(async(req, res,
req.brew = req.brew.toObject ? req.brew.toObject() : req.brew;
req.userThemes = await(getUsersBrewThemes(req.account?.username));
req.isOwner = req.account && (req.account.username == req.brew.authors[0]);
req.ogMeta = { ...defaultMetaTags,
title : req.brew.title || 'Untitled Brew',
description : req.brew.description || 'No description.',
@@ -564,7 +564,8 @@ const renderPage = async (req, res)=>{
enable_themes : config.get('enable_themes'),
config : configuration,
ogMeta : req.ogMeta,
userThemes : req.userThemes
userThemes : req.userThemes,
isOwner : req.isOwner,
};
const title = req.brew ? req.brew.title : '';
const page = await templateFn('homebrew', title, props)