public async Task <IActionResult> GetPost(int id) { PostDto postDto = _mapper.Map <PostDto>(await _getPostInput.GetPost(id)); ApiResponse <PostDto> apiResponse = new ApiResponse <PostDto>(postDto); return(Ok(apiResponse)); }
public async Task <bool> UpdatePost(Post post) { Post currentPost = await _getPostInput.GetPost(post.Id); if (currentPost != null) { currentPost.Image = post.Image; currentPost.Description = post.Description; await _updatePostOutput.UpdatePost(currentPost); return(true); } return(false); }