Ejemplo n.º 1
0
        public async Task <IActionResult> CommentOnPost([FromBody] FeedComment comment, CancellationToken ct = default)
        {
            if (!AuthenticationUtilities.IsAllowedFeed(User))
            {
                return(BadRequest("User has been banned from Feed"));
            }
            if (!AuthenticationUtilities.IsSameUser(User, comment.UserUUID))
            {
                return(Unauthorized("You do not have access to comment for this user"));
            }

            return(Ok(await _feedService.AddCommentToPostAsync(comment, ct)));
        }