migrations/20200406100225_users_add_emoji: Fix tag to Emoji filtering, electric bongaloo
This commit is contained in:
parent
46f051048f
commit
eb61564005
|
@ -1430,7 +1430,10 @@ defp object_to_user_data(data) do
|
|||
emojis =
|
||||
data
|
||||
|> Map.get("tag", [])
|
||||
|> Enum.filter(fn data -> data["type"] == "Emoji" and data["icon"] end)
|
||||
|> Enum.filter(fn
|
||||
%{"type" => t} -> t == "Emoji"
|
||||
_ -> false
|
||||
end)
|
||||
|> Enum.reduce(%{}, fn %{"icon" => %{"url" => url}, "name" => name}, acc ->
|
||||
Map.put(acc, String.trim(name, ":"), url)
|
||||
end)
|
||||
|
|
|
@ -17,7 +17,10 @@ def up do
|
|||
emoji =
|
||||
user.source_data
|
||||
|> Map.get("tag", [])
|
||||
|> Enum.filter(fn data -> data["type"] == "Emoji" and data["icon"] end)
|
||||
|> Enum.filter(fn
|
||||
%{"type" => t} -> t == "Emoji"
|
||||
_ -> false
|
||||
end)
|
||||
|> Enum.reduce(%{}, fn %{"icon" => %{"url" => url}, "name" => name}, acc ->
|
||||
Map.put(acc, String.trim(name, ":"), url)
|
||||
end)
|
||||
|
|
Loading…
Reference in a new issue