article detail page @public
This commit is contained in:
parent
3374eb1ec0
commit
000ebd388a
@ -91,13 +91,18 @@ export class CommentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Get('reactions/user')
|
@Get('reactions/user')
|
||||||
@UseGuards(JwtAuthGuard)
|
@Public()
|
||||||
async getUserReaction(
|
async getUserReaction(
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Query('articleId') articleId?: string,
|
@Query('articleId') articleId?: string,
|
||||||
@Query('liveBlogId') liveBlogId?: string,
|
@Query('liveBlogId') liveBlogId?: string,
|
||||||
@Query('commentId') commentId?: string,
|
@Query('commentId') commentId?: string,
|
||||||
): Promise<{ type: string | null }> {
|
): Promise<{ type: string | null }> {
|
||||||
|
// If user is not authenticated, return null
|
||||||
|
if (!req.user?.id) {
|
||||||
|
return { type: null };
|
||||||
|
}
|
||||||
|
|
||||||
const reaction = await this.commentService.getUserReaction(
|
const reaction = await this.commentService.getUserReaction(
|
||||||
req.user.id,
|
req.user.id,
|
||||||
articleId,
|
articleId,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user