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

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

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,