Skip to content

Commit 66a4bca

Browse files
bdukesmadskristensen
authored andcommitted
Fix images saving as base64 (madskristensen#93)
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.
1 parent 14ec33b commit 66a4bca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Controllers/BlogController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ public async Task<IActionResult> UpdatePost(Post post)
111111
existing.Content = post.Content.Trim();
112112
existing.Excerpt = post.Excerpt.Trim();
113113

114-
await _blog.SavePost(existing);
115-
116114
await SaveFilesToDisk(existing);
117115

116+
await _blog.SavePost(existing);
117+
118118
return Redirect(post.GetEncodedLink());
119119
}
120120

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

0 commit comments

Comments
 (0)