fix: A1-2 delete translation files from disk when parent post is deleted

This commit is contained in:
2026-05-28 18:47:27 +02:00
parent 82ce445c44
commit e2c92cb90d
3 changed files with 41 additions and 1 deletions

View File

@@ -309,8 +309,11 @@ defmodule BDS.Posts do
select: pm.media_id
)
{:ok, translations} = Translations.list_post_translations(post.id)
case Repo.delete(post) do
{:ok, deleted_post} ->
Enum.each(translations, &FileSync.delete_translation_file/1)
delete_post_file(deleted_post)
Embeddings.remove_post(deleted_post.id)
PostLinks.delete_post_links(deleted_post.id)