emoji =
Emoji.get_all()
|> Enum.map(fn {short_code, path, tags} ->
- %{short_code => %{image_url: path, tags: String.split(tags, ",")}}
+ {short_code, %{image_url: path, tags: String.split(tags, ",")}}
end)
+ |> Enum.into(%{})
json(conn, emoji)
end
end
def follow_import(%{assigns: %{user: follower}} = conn, %{"list" => list}) do
- with followed_identifiers <- String.split(list),
+ with lines <- String.split(list, "\n"),
+ followed_identifiers <-
+ Enum.map(lines, fn line ->
+ String.split(line, ",") |> List.first()
+ end)
+ |> List.delete("Account address"),
{:ok, _} = Task.start(fn -> User.follow_import(follower, followed_identifiers) end) do
json(conn, "job started")
end