public async Task <OrderCommentDTO> UpdateOrderComment(OrderCommentToUpdateDTO commentToUpdate) { var comment = await _commentRepo.GetOrderCommentByIdAsync(commentToUpdate.CommentId); comment.Message = commentToUpdate.Message; return(ConvertOrderComment(await _genericRepo.UpdateAsync(comment))); }
public async Task <IActionResult> Post(OrderCommentToUpdateDTO comment) { comment.Message = _javaScriptEncoder.Encode(_htmlEncoder.Encode(comment.Message)); if (await _commentServices.GetOrderCommentById(comment.CommentId) == null) { return(StatusCode(400, "Comment with id " + comment.CommentId + " was not found.")); } await _commentServices.UpdateOrderComment(comment); return(StatusCode(200)); }