mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-18 15:14:42 +00:00
pagination.ex: Drop atom keys in params
Atom keys could also have been transformed to string, or the other way around but this one is more efficient and what we actually expect with the current param_types in Pagination
This commit is contained in:
parent
6f15224053
commit
e83ad12c57
1 changed files with 6 additions and 0 deletions
|
@ -36,6 +36,12 @@ defmodule Pleroma.Pagination do
|
|||
limit: :integer
|
||||
}
|
||||
|
||||
params =
|
||||
Enum.reduce(params, %{}, fn
|
||||
{key, _value}, acc when is_atom(key) -> Map.drop(acc, [key])
|
||||
{key, value}, acc -> Map.put(acc, key, value)
|
||||
end)
|
||||
|
||||
changeset = cast({%{}, param_types}, params, Map.keys(param_types))
|
||||
changeset.changes
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue