public IActionResult UnDisLikeComment([FromBody] CommentIdModel model) { CommentLikeReturnModel ret; if (model == null) { return(BadRequest()); } Claim idClaim = User.FindFirst("sub"); if (idClaim == null) { return(StatusCode(401)); } else { ret = _commentActionService.UnDislikeComment(idClaim.Value, model.CommentId); if (ret.IsActionSucceed) { _bus.Publish <UserUndislikedCommentAction>(new UserUndislikedCommentAction() { DateUtcAction = DateTime.UtcNow, CommentId = model.CommentId, UserId = idClaim.Value }); } } return(Ok(ret)); }
public IActionResult DeleteComment([FromBody] CommentIdModel model) { BaseReturnModel ret; if (model == null) { return(BadRequest()); } Claim idClaim = User.FindFirst("sub"); if (idClaim == null) { return(Unauthorized()); } else { ret = _commentActionService.RemoveComment(model.CommentId, idClaim.Value); } return(Ok(ret)); }