Return the saved blog post
This commit is contained in:
parent
1bbad42a3f
commit
cfcef8b77d
2 changed files with 13 additions and 15 deletions
|
@ -78,7 +78,7 @@ namespace Robware.Api.Blog.Controllers {
|
|||
}
|
||||
|
||||
[HttpPost(nameof(SavePost))]
|
||||
public async Task<ActionResult> SavePost(BlogPostSubmission submission) {
|
||||
public async Task<ActionResult<BlogPost>> SavePost(BlogPostSubmission submission) {
|
||||
_logger.Log(LogLevel.Information, $"{nameof(SavePost)}: {nameof(submission)}={JsonConvert.SerializeObject(submission)}");
|
||||
|
||||
try {
|
||||
|
@ -87,8 +87,7 @@ namespace Robware.Api.Blog.Controllers {
|
|||
post.UpdateTitle(submission.Title);
|
||||
post.UpdateDraft(submission.Content);
|
||||
|
||||
await _blogRepository.SavePost(post);
|
||||
return Ok();
|
||||
return await _blogRepository.SavePost(post);
|
||||
}
|
||||
catch (ItemNotFoundException e) {
|
||||
_logger.Log(LogLevel.Error, e.Message);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue