Apply suggestion to priv/repo/migrations/20200406100225_users_add_emoji.exs

This commit is contained in:
Haelwenn 2020-04-17 22:48:40 +00:00
parent 24f760c2f7
commit d698ecef9b

View File

@ -18,7 +18,7 @@ def up do
user.source_data user.source_data
|> Map.get("tag", []) |> Map.get("tag", [])
|> Enum.filter(fn |> Enum.filter(fn
%{"type" => t} -> t == "Emoji" %{"type" => "Emoji"} -> true
_ -> false _ -> false
end) end)
|> Enum.reduce(%{}, fn %{"icon" => %{"url" => url}, "name" => name}, acc -> |> Enum.reduce(%{}, fn %{"icon" => %{"url" => url}, "name" => name}, acc ->