public async Task <int> Handle(ReplyPostCommand request, CancellationToken cancellationToken) { var userId = Guid.Parse(_httpContextAccessor.HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value); var command = new UserReplyPostCommand { RepliedUserId = userId, Text = request.Text, PostId = request.PostId }; return(await _mediator.Send(command)); }
//[Authorize(Policy = "AdminOnly")] public async Task <ActionResult <int> > UserReplyPostAsync([FromBody] UserReplyPostCommand command) { var commentCount = await _mediator.Send(command); return(Ok(ResponseWrapper.CreateOkResponseWrapper(commentCount))); }