fix /v1/statuses/<id>/favourited_by pagination header error (#550)
This commit is contained in:
parent
e45195bb02
commit
ba4414dbce
|
@ -16,7 +16,7 @@ from activities.models import (
|
||||||
from activities.services import PostService
|
from activities.services import PostService
|
||||||
from api import schemas
|
from api import schemas
|
||||||
from api.decorators import scope_required
|
from api.decorators import scope_required
|
||||||
from api.pagination import MastodonPaginator, PaginationResult
|
from api.pagination import MastodonPaginator, PaginatingApiResponse, PaginationResult
|
||||||
from core.models import Config
|
from core.models import Config
|
||||||
|
|
||||||
|
|
||||||
|
@ -230,10 +230,7 @@ def favourited_by(
|
||||||
limit=limit,
|
limit=limit,
|
||||||
)
|
)
|
||||||
|
|
||||||
headers = {}
|
return PaginatingApiResponse(
|
||||||
if pager.results:
|
|
||||||
headers = {"link": pager.link_header(request, ["limit"])}
|
|
||||||
return ApiResponse(
|
|
||||||
[
|
[
|
||||||
schemas.Account.from_identity(
|
schemas.Account.from_identity(
|
||||||
interaction.identity,
|
interaction.identity,
|
||||||
|
@ -241,7 +238,11 @@ def favourited_by(
|
||||||
)
|
)
|
||||||
for interaction in pager.results
|
for interaction in pager.results
|
||||||
],
|
],
|
||||||
headers=headers,
|
request=request,
|
||||||
|
include_params=[
|
||||||
|
"limit",
|
||||||
|
"id",
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue