Exemple #1
0
        public async Task <IActionResult> SetCommentReaction([FromBody] CommentReactionDto dto)
        {
            if (!HttpContext.User.Identity.IsAuthenticated)
            {
                return(Forbid());
            }
            Result <ReactionDto> result = await _commentService.SetCommentReactionAsync(dto, UserId);

            return(FromResult(result));
        }
Exemple #2
0
 public async Task <Result <ReactionDto> > SetCommentReactionAsync(CommentReactionDto dto, string userId)
 {
     return(await _setCommentReactionHandler.HandleAsync(
                new SetCommentReactionCommand(dto.CommentId, dto.ParentCommentId, dto.Liked, userId)
                ));
 }