fix: worked on CSM-003
This commit is contained in:
@@ -396,8 +396,10 @@ defmodule BDS.Posts.TranslationValidation do
|
||||
when is_binary(translation_id) do
|
||||
case Repo.get(Translation, translation_id) do
|
||||
%Translation{} = translation ->
|
||||
Repo.delete!(translation)
|
||||
{:deleted, translation_for}
|
||||
case Repo.delete(translation) do
|
||||
{:ok, _} -> {:deleted, translation_for}
|
||||
{:error, _} -> :noop
|
||||
end
|
||||
|
||||
nil ->
|
||||
:noop
|
||||
|
||||
@@ -97,10 +97,15 @@ defmodule BDS.Posts.Translations do
|
||||
{:error, :not_found}
|
||||
|
||||
%Translation{} = translation ->
|
||||
:ok = FileSync.delete_translation_file(translation)
|
||||
Repo.delete!(translation)
|
||||
:ok = Search.sync_post(translation.translation_for)
|
||||
{:ok, :deleted}
|
||||
case Repo.delete(translation) do
|
||||
{:ok, deleted_translation} ->
|
||||
FileSync.delete_translation_file(deleted_translation)
|
||||
Search.sync_post(deleted_translation.translation_for)
|
||||
{:ok, :deleted}
|
||||
|
||||
{:error, changeset} ->
|
||||
{:error, changeset}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user