Example #1
0
        public async Task <ActionResult <PostDTO> > updatePosts(string id, [FromBody] PostDTO post)
        {
            if (post == null)
            {
                return(BadRequest());
            }
            if (string.IsNullOrEmpty(id))
            {
                return(Problem(statusCode: 422, title: "Invalid data, Id property cannot be empty!"));
            }

            var response = await _postsDomain.updatePost(id, post);

            return(Ok(response));
        }