added Emoji struct
This commit is contained in:
parent
d8098d142a
commit
6ef0103ca0
8 changed files with 47 additions and 31 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue