public async Task <IActionResult> UpdateComment([FromBody] UpdateCommentVm model) { model.UserId = this.CurrentUserId.Value; await _commentsService.UpdateComment(model); return(this.Ok()); }
public async Task UpdateComment(UpdateCommentVm model) { if (!await _commentsRepository.UserIsCommentOwner(model.UserId, model.Id)) { throw new AccessDeniedException(); } await _commentsRepository.UpdateComment(_mapper.Map <UpdateCommentDto>(model)); }