public ActionResult <Comment> Post(string postId, [FromBody] Comment comment)
 {
     return(_postService.CreateComment(postId, comment));
 }
Exemple #2
0
        public CommentReadDto CreateComment(int postId, [FromBody] CommentCreateDto dto)
        {
            var userId = GetUserIdFromToken();

            return(_postService.CreateComment(dto, postId, userId));
        }
Exemple #3
0
        public ActionResult <Post> Create(string postId, Comment comment)
        {
            Post result = _postService.CreateComment(postId, comment);

            return(CreatedAtRoute("GetPost", new { id = result.Id }, result));
        }