added Emoji struct

This commit is contained in:
Maksim Pechnikov 2019-08-31 10:14:53 +03:00
commit 6ef0103ca0
8 changed files with 47 additions and 31 deletions

View file

@ -239,11 +239,9 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
def emoji(conn, _params) do
emoji =
Emoji.get_all()
|> Enum.map(fn {short_code, path, tags, _, _} ->
{short_code, %{image_url: path, tags: tags}}
Enum.reduce(Emoji.get_all(), %{}, fn {code, %Emoji{file: file, tags: tags}}, acc ->
Map.put(acc, code, %{image_url: file, tags: tags})
end)
|> Enum.into(%{})
json(conn, emoji)
end