mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 02:05:12 +00:00
mastodon_api_controller.ex: fallback to first for min_id
This commit is contained in:
parent
6b407872b4
commit
c8abef373b
|
@ -212,7 +212,16 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
|
|||
|> Map.get("limit", "20")
|
||||
|> String.to_integer()
|
||||
|
||||
min_id = Enum.at(activities, limit * -1)
|
||||
min_id =
|
||||
if length(activities) <= limit do
|
||||
activities
|
||||
|> List.first()
|
||||
|> Map.get(:id)
|
||||
else
|
||||
activities
|
||||
|> Enum.at(limit * -1)
|
||||
|> Map.get(:id)
|
||||
end
|
||||
|
||||
{next_url, prev_url} =
|
||||
if param do
|
||||
|
|
Loading…
Reference in a new issue