Fix refactoring opportunities

This commit is contained in:
miffigriffi
2019-09-22 13:41:24 +02:00
committed by Thomas Citharel
parent 4d4fdaaffe
commit 20dfce5c83
18 changed files with 122 additions and 90 deletions

View File

@@ -24,7 +24,8 @@ defmodule Mobilizon.Service.ActivityPub.Transmogrifier do
if is_binary(Enum.at(actor, 0)) do
Enum.at(actor, 0)
else
Enum.find(actor, fn %{"type" => type} -> type in ["Person", "Service", "Application"] end)
actor
|> Enum.find(fn %{"type" => type} -> type in ["Person", "Service", "Application"] end)
|> Map.get("id")
end
end