diff --git a/src/post/post.repository.ts b/src/post/post.repository.ts index 4f92fba..20a89ac 100644 --- a/src/post/post.repository.ts +++ b/src/post/post.repository.ts @@ -17,11 +17,16 @@ export class PostRepository { async getPost(id: number) { this.logger.log('getPost'); return this.prismaService.post - .findUniqueOrThrow({ + .update({ where: { id, deletedAt: null, }, + data: { + views: { + increment: 1, + }, + }, include: { author: { select: {