fix: the get blog by slug for the users

This commit is contained in:
mahyargdz
2025-04-21 10:01:43 +03:30
parent 61b3f4a066
commit 41b0652c47
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -183,7 +183,7 @@ export class BlogsService {
const blog = await this.blogsRepository.findOneBySlug(slug);
if (!blog) throw new BadRequestException(BlogMessage.BLOG_NOT_FOUND);
if (!isAdmin) return { blog };
if (isAdmin) return { blog };
blog.viewCount += 1;
await this.blogsRepository.save(blog);