Ejemplo n.º 1
0
        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 }));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> CreateComment(CreateCommentRequest createCommentRequest)
        {
            await _commentsService.CreateCommentAsync(createCommentRequest);

            return(Ok());
        }