From ba4414dbce1088572d6b07aa48e37b1f229c6865 Mon Sep 17 00:00:00 2001 From: Christof Dorner Date: Fri, 24 Mar 2023 02:09:03 +0100 Subject: [PATCH] fix /v1/statuses//favourited_by pagination header error (#550) --- api/views/statuses.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/api/views/statuses.py b/api/views/statuses.py index 287d5e2..f2d2594 100644 --- a/api/views/statuses.py +++ b/api/views/statuses.py @@ -16,7 +16,7 @@ from activities.models import ( from activities.services import PostService from api import schemas from api.decorators import scope_required -from api.pagination import MastodonPaginator, PaginationResult +from api.pagination import MastodonPaginator, PaginatingApiResponse, PaginationResult from core.models import Config @@ -230,10 +230,7 @@ def favourited_by( limit=limit, ) - headers = {} - if pager.results: - headers = {"link": pager.link_header(request, ["limit"])} - return ApiResponse( + return PaginatingApiResponse( [ schemas.Account.from_identity( interaction.identity, @@ -241,7 +238,11 @@ def favourited_by( ) for interaction in pager.results ], - headers=headers, + request=request, + include_params=[ + "limit", + "id", + ], )