fix: A1-3 publish_post deletes old file when post path changes

This commit is contained in:
hugo committed 2026-05-28 21:15:58 +02:00
1 parent e2c92cb90d
commit ff89d78ab4
3 files changed
+38 -1

No files matched your search

+4
View File
@@ -171,6 +171,10 @@ defmodule BDS.Posts do
serialize_post_file(%{post | updated_at: updated_at, content: body}, published_at)
)
if post.file_path != "" and post.file_path != relative_path do
delete_post_file(post)
end
post
|> Post.changeset(%{
status: :published,