Skip to content

Commit

Permalink
๐Ÿ›Fix : ํฌ์ŠคํŠธ ๋Œ“๊ธ€ ์กฐํšŒ ์‹œ, ๋นˆ ๋ฐฐ์—ด ๋ฐ˜ํ™˜ํ•˜๋Š” ๋ฌธ์ œ ํ•ด๊ฒฐ
Browse files Browse the repository at this point in the history
๐Ÿ›Fix : ํฌ์ŠคํŠธ ๋Œ“๊ธ€  ์กฐํšŒ ์‹œ, ๋นˆ ๋ฐฐ์—ด ๋ฐ˜ํ™˜ํ•˜๋Š” ๋ฌธ์ œ ํ•ด๊ฒฐ
  • Loading branch information
june960427 authored Oct 28, 2024
2 parents 8b75573 + 3ee80a0 commit 20d8177
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/src/comment/comment.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class CommentController {
})
@ApiResponse({ status: 400, description: '์ž˜๋ชป๋œ ์š”์ฒญ' })
async createComment(
@Param('postId') postId: string,
@Param('postId') postId: Types.ObjectId,
@Body() createCommentDto: CreateCommentDto, // DTO ์‚ฌ์šฉ
@Req() req: any,
) {
Expand Down
4 changes: 3 additions & 1 deletion backend/src/comment/comment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export class CommentService {

// ํŠน์ • ๊ฒŒ์‹œ๊ธ€์˜ ๋Œ“๊ธ€ ์กฐํšŒ
async findByPostId(postId: string): Promise<Comment[]> {
return this.commentModel.find({ postId }).exec();
return this.commentModel
.find({ postId: new Types.ObjectId(postId) })
.exec();
}

// ๋Œ“๊ธ€ ์ˆ˜์ •
Expand Down

0 comments on commit 20d8177

Please sign in to comment.