diff --git a/app/controllers/post.js b/app/controllers/post.js index bcd7c9b..9d1b587 100644 --- a/app/controllers/post.js +++ b/app/controllers/post.js @@ -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);