mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-25 23:43:24 +00:00
Search: limit number of results
This commit is contained in:
parent
0b2119d4a7
commit
108dfd1f87
|
@ -17,6 +17,8 @@ defmodule Pleroma.Web.MastodonAPI.SearchController do
|
|||
|
||||
require Logger
|
||||
|
||||
@search_limit 40
|
||||
|
||||
plug(Pleroma.Web.ApiSpec.CastAndValidate)
|
||||
|
||||
# Note: Mastodon doesn't allow unauthenticated access (requires read:accounts / read:search)
|
||||
|
@ -77,7 +79,7 @@ defmodule Pleroma.Web.MastodonAPI.SearchController do
|
|||
[
|
||||
resolve: params[:resolve],
|
||||
following: params[:following],
|
||||
limit: params[:limit],
|
||||
limit: min(params[:limit], @search_limit),
|
||||
offset: params[:offset],
|
||||
type: params[:type],
|
||||
author: get_author(params),
|
||||
|
|
Loading…
Reference in a new issue