projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'feature/cli-reload-emoji' into 'develop'
[akkoma]
/
lib
/
pleroma
/
web
/
controller_helper.ex
diff --git
a/lib/pleroma/web/controller_helper.ex
b/lib/pleroma/web/controller_helper.ex
index 2d35bb56cddd3e5b568b16a587e9f3eab2b91ab6..5d67d75b5fd09bdb5d0cf793e9be5c3abfeccc3d 100644
(file)
--- a/
lib/pleroma/web/controller_helper.ex
+++ b/
lib/pleroma/web/controller_helper.ex
@@
-63,8
+63,8
@@
defmodule Pleroma.Web.ControllerHelper do
params =
conn.params
|> Map.drop(Map.keys(conn.path_params))
params =
conn.params
|> Map.drop(Map.keys(conn.path_params))
- |> Map.drop(["since_id", "max_id", "min_id"])
|> Map.merge(extra_params)
|> Map.merge(extra_params)
+ |> Map.drop(Pagination.page_keys() -- ["limit", "order"])
min_id =
activities
min_id =
activities
@@
-93,8
+93,7
@@
defmodule Pleroma.Web.ControllerHelper do
end
def assign_account_by_id(conn, _) do
end
def assign_account_by_id(conn, _) do
- # TODO: use `conn.params[:id]` only after moving to OpenAPI
- case Pleroma.User.get_cached_by_id(conn.params[:id] || conn.params["id"]) do
+ case Pleroma.User.get_cached_by_id(conn.params.id) do
%Pleroma.User{} = account -> assign(conn, :account, account)
nil -> Pleroma.Web.MastodonAPI.FallbackController.call(conn, {:error, :not_found}) |> halt()
end
%Pleroma.User{} = account -> assign(conn, :account, account)
nil -> Pleroma.Web.MastodonAPI.FallbackController.call(conn, {:error, :not_found}) |> halt()
end
@@
-111,11
+110,6
@@
defmodule Pleroma.Web.ControllerHelper do
render_error(conn, :not_implemented, "Can't display this activity")
end
render_error(conn, :not_implemented, "Can't display this activity")
end
- @spec put_if_exist(map(), atom() | String.t(), any) :: map()
- def put_if_exist(map, _key, nil), do: map
-
- def put_if_exist(map, key, value), do: Map.put(map, key, value)
-
@doc """
Returns true if request specifies to include embedded relationships in account objects.
May only be used in selected account-related endpoints; has no effect for status- or
@doc """
Returns true if request specifies to include embedded relationships in account objects.
May only be used in selected account-related endpoints; has no effect for status- or