projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into alexgleason/pleroma...
[akkoma]
/
lib
/
pleroma
/
web
/
pleroma_api
/
controllers
/
emoji_pack_controller.ex
diff --git
a/lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex
b/lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex
index d1efdeb5d8db98d8cb2c979668d83b7d6441b24d..657f4632451a192a0bf34dccb1bfe928d5e3c5d6 100644
(file)
--- a/
lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex
+++ b/
lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex
@@
-21,8
+21,8
@@
defmodule Pleroma.Web.PleromaAPI.EmojiPackController do
]
)
]
)
- @skip_plugs [Pleroma.Plugs.OAuthScopesPlug, Pleroma.Plugs.E
xpectPublicOrAuthenticatedCheck
Plug]
- plug(:skip_plug, @skip_plugs when action in [:
archive, :show, :list
])
+ @skip_plugs [Pleroma.Plugs.OAuthScopesPlug, Pleroma.Plugs.E
nsurePublicOrAuthenticated
Plug]
+ plug(:skip_plug, @skip_plugs when action in [:
index, :show, :archive
])
defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.PleromaEmojiPackOperation
defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.PleromaEmojiPackOperation
@@
-37,14
+37,14
@@
defmodule Pleroma.Web.PleromaAPI.EmojiPackController do
end
end
end
end
- def index(conn,
_
params) do
+ def index(conn, params) do
emoji_path =
[:instance, :static_dir]
|> Pleroma.Config.get!()
|> Path.join("emoji")
emoji_path =
[:instance, :static_dir]
|> Pleroma.Config.get!()
|> Path.join("emoji")
- with {:ok, packs
} <- Pack.list_local(
) do
- json(conn,
packs
)
+ with {:ok, packs
, count} <- Pack.list_local(page: params.page, page_size: params.page_size
) do
+ json(conn,
%{packs: packs, count: count}
)
else
{:error, :create_dir, e} ->
conn
else
{:error, :create_dir, e} ->
conn
@@
-60,10
+60,10
@@
defmodule Pleroma.Web.PleromaAPI.EmojiPackController do
end
end
end
end
- def show(conn, %{name: name}) do
+ def show(conn, %{name: name
, page: page, page_size: page_size
}) do
name = String.trim(name)
name = String.trim(name)
- with {:ok, pack} <- Pack.show(name) do
+ with {:ok, pack} <- Pack.show(name
: name, page: page, page_size: page_size
) do
json(conn, pack)
else
{:error, :not_found} ->
json(conn, pack)
else
{:error, :not_found} ->