From 379680565b8bf6aad92f42235081dd2b25bb1fcb Mon Sep 17 00:00:00 2001 From: Phill Pover Date: Sat, 29 Mar 2025 09:00:00 +0000 Subject: [PATCH] Fixing comment import --- backend/src/post/post.controller.ts | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/backend/src/post/post.controller.ts b/backend/src/post/post.controller.ts index 2c90f16..f80d16d 100644 --- a/backend/src/post/post.controller.ts +++ b/backend/src/post/post.controller.ts @@ -1,4 +1,19 @@ -import { Controller } from '@nestjs/common'; +import { Controller, Get, Param } from '@nestjs/common'; +import { PostService } from './post.service'; -@Controller('post') -export class PostController {} +@Controller('posts') +export class PostController { + + constructor(private readonly postService: PostService) {} + + @Get() + async findAll() { + return this.postService.findAll(); + } + + @Get(':id/comments') + async findCommentsByPostId(@Param('id') postId: string) { + return this.postService.findCommentsByPostId(+postId); + } + +}