Fix delete-by_ap_id to expect not only embeded objects

This commit is contained in:
rinpatch 2019-04-17 16:35:01 +03:00
parent 8e4d950f31
commit 4c289e924e
1 changed files with 1 additions and 0 deletions

View File

@ -230,6 +230,7 @@ def delete_by_ap_id(id) when is_binary(id) do
|> Repo.delete_all()
|> elem(1)
|> Enum.find(fn
%{data: %{"type" => "Create", "object" => ap_id}} when is_binary(ap_id) -> ap_id == id
%{data: %{"type" => "Create", "object" => %{"id" => ap_id}}} -> ap_id == id
_ -> nil
end)