0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-28 00:32:42 +00:00

remove prop drilling

This commit is contained in:
Víctor Losada Hernández
2025-07-18 16:39:00 +02:00
parent e0bba53df1
commit d5645083f3
5 changed files with 4 additions and 8 deletions

View File

@@ -378,7 +378,6 @@ 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.',
@@ -566,7 +565,6 @@ const renderPage = async (req, res)=>{
config : configuration,
ogMeta : req.ogMeta,
userThemes : req.userThemes,
isOwner : req.isOwner,
};
const title = req.brew ? req.brew.title : '';
const page = await templateFn('homebrew', title, props)