mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-31 08:42:40 +00:00
My god it works
This commit is contained in:
@@ -348,7 +348,6 @@ app.get('/share/:id', asyncHandler(getBrew('share')), asyncHandler(async (req, r
|
||||
await HomebrewModel.increaseView({ shareId: brew.shareId });
|
||||
}
|
||||
};
|
||||
req.brew.userThemes = await getUsersBrewThemes(req.account.username, req.brew.editId);
|
||||
sanitizeBrew(req.brew, 'share');
|
||||
splitTextStyleAndMetadata(req.brew);
|
||||
return next();
|
||||
@@ -356,7 +355,6 @@ app.get('/share/:id', asyncHandler(getBrew('share')), asyncHandler(async (req, r
|
||||
|
||||
//Print Page
|
||||
app.get('/print/:id', asyncHandler(getBrew('share')), async (req, res, next)=>{
|
||||
req.brew.userThemes = await getUsersBrewThemes(req.account.username, req.brew.editId);
|
||||
sanitizeBrew(req.brew, 'share');
|
||||
splitTextStyleAndMetadata(req.brew);
|
||||
next();
|
||||
|
||||
@@ -158,7 +158,11 @@ const api = {
|
||||
throw { name: 'BrewLoad Error', message: 'Brew not found', status: 404, HBErrorCode: '05', accessType: accessType, brewId: id };
|
||||
}
|
||||
|
||||
const userID = accessType === 'edit' ? req.account.username : stub.authors.split(',')[0];
|
||||
console.log(`print`);
|
||||
console.log(accessType);
|
||||
console.log(stub);
|
||||
console.log(`print`);
|
||||
const userID = accessType === 'edit' ? req.account.username : stub.authors[0];
|
||||
|
||||
// Clean up brew: fill in missing fields with defaults / fix old invalid values
|
||||
const userThemes = await getUsersBrewThemes(userID, id);
|
||||
|
||||
Reference in New Issue
Block a user