Fix in postController

master
Andrew 1 year ago
parent d4839e2d3b
commit 57ae7c4091

@ -343,9 +343,9 @@ class PostController extends SiteController {
throw new SiteError(403, 'The post is not published');
}
}
await resourceService.recordView(req, 'Post', res.locals.post._id);
if (res.locals.post.status === 'published') {
await resourceService.recordView(req, 'Post', res.locals.post._id);
}
res.locals.countPerPage = 20;
res.locals.pagination = this.getPaginationParameters(req, res.locals.countPerPage);

Loading…
Cancel
Save