Skip to content

Commit

Permalink
Fix images saving as base64 (madskristensen#93)
Browse files Browse the repository at this point in the history
When saving a post, there is code to extract the base64 encoded images into files and update the post content to point to those newly saved files.  However, this runs after the blog post is saved, so the updates to the blog post's markup aren't persisted.  The files are correctly saved, but the post's markup still includes base64 encoded images.
  • Loading branch information
bdukes authored and madskristensen committed Oct 3, 2018
1 parent 14ec33b commit 66a4bca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Controllers/BlogController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ public async Task<IActionResult> UpdatePost(Post post)
existing.Content = post.Content.Trim();
existing.Excerpt = post.Excerpt.Trim();

await _blog.SavePost(existing);

await SaveFilesToDisk(existing);

await _blog.SavePost(existing);

return Redirect(post.GetEncodedLink());
}

Expand Down Expand Up @@ -219,4 +219,4 @@ public async Task<IActionResult> DeleteComment(string postId, string commentId)
return Redirect(post.GetEncodedLink() + "#comments");
}
}
}
}

0 comments on commit 66a4bca

Please sign in to comment.