Merge pull request #8218 from MrPetovan/bug/notices

Remove next link when there aren't any introductions in Module\Api\Mastodon\FollowRequests
This commit is contained in:
Tobias Diekershoff 2020-02-02 08:03:16 +01:00 committed by GitHub
commit 46e89299c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,7 +106,10 @@ class FollowRequests extends BaseApi
if ($introductions->getTotalCount() > $limit) { if ($introductions->getTotalCount() > $limit) {
$links[] = '<' . $baseUrl->get() . '/api/v1/follow_requests?' . http_build_query($base_query + ['max_id' => $introductions[count($introductions) - 1]->id]) . '>; rel="next"'; $links[] = '<' . $baseUrl->get() . '/api/v1/follow_requests?' . http_build_query($base_query + ['max_id' => $introductions[count($introductions) - 1]->id]) . '>; rel="next"';
} }
$links[] = '<' . $baseUrl->get() . '/api/v1/follow_requests?' . http_build_query($base_query + ['since_id' => $introductions[0]->id]) . '>; rel="prev"';
if (count($introductions)) {
$links[] = '<' . $baseUrl->get() . '/api/v1/follow_requests?' . http_build_query($base_query + ['since_id' => $introductions[0]->id]) . '>; rel="prev"';
}
header('Link: ' . implode(', ', $links)); header('Link: ' . implode(', ', $links));