mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-09-27 22:03:09 +00:00
Centralize API.getBrew descended calls to splitTextStyleAndMetadata.
This does not address "static" pages nor change tests that called splitTextStyleAndMetadata in their own fashion.
This commit is contained in:
@@ -395,7 +395,6 @@ export default async function createApp(vite) {
|
||||
};
|
||||
|
||||
sanitizeBrew(req.brew, 'edit');
|
||||
splitTextStyleAndMetadata(req.brew);
|
||||
res.header('Cache-Control', 'no-cache, no-store'); //reload the latest saved brew when pressing back button, not the cached version before save.
|
||||
return next();
|
||||
}));
|
||||
@@ -403,7 +402,6 @@ export default async function createApp(vite) {
|
||||
//New Page from ID
|
||||
app.get('/new/:id', asyncHandler(getBrew('share')), asyncHandler(async(req, res, next)=>{
|
||||
sanitizeBrew(req.brew, 'share');
|
||||
splitTextStyleAndMetadata(req.brew);
|
||||
const brew = {
|
||||
shareId : req.brew.shareId,
|
||||
title : `CLONE - ${req.brew.title}`,
|
||||
@@ -461,7 +459,6 @@ export default async function createApp(vite) {
|
||||
};
|
||||
|
||||
brew.authors.includes(req.account?.username) ? sanitizeBrew(req.brew, 'shareAuthor') : sanitizeBrew(req.brew, 'share');
|
||||
splitTextStyleAndMetadata(req.brew);
|
||||
return next();
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user