public async Task <IActionResult> AddCommentAsync( int id, int projectId, CommentViewModel newComment) { if (!ModelState.IsValid) { return(RedirectToAction("Details", new { projectId, id })); } var result = await comments.CreateCommentAsync( projectId, id, newComment.Text, User); this.AddNotification(result.Message, result.NotificationType); return(RedirectToAction("Details", new { projectId, id })); }
public async Task <IActionResult> CreateComment(CreateCommentRequest createCommentRequest) { await _commentsService.CreateCommentAsync(createCommentRequest); return(Ok()); }