0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-29 02:32:37 +00:00

fix created, updated published last viewed

This commit is contained in:
Victor Losada Hernandez
2023-01-28 11:47:26 +01:00
parent 62d193ddd1
commit 541109e7b1

View File

@@ -294,7 +294,12 @@ app.get('/edit/:id', asyncHandler(getBrew('edit')), (req, res, next)=>{
app.get('/new/:id', asyncHandler(getBrew('share')), (req, res, next)=>{
sanitizeBrew(req.brew, 'share');
splitTextStyleAndMetadata(req.brew);
req.brew.views = 0;
req.brew.published = false;
req.brew.createdAt = clock.now;
req.brew.updatedAt = clock.now;
req.brew.views = 1;
req.brew.lastViewed = clock.now;
req.brew.title = `CLONE - ${req.brew.title}`;
req.ogMeta = { ...defaultMetaTags,