From 7293d6029b43db693fd170c0c087394339da0677 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Tue, 12 Sep 2023 14:00:35 +0100 Subject: [feature] add paging to account follows, followers and follow requests endpoints (#2186) --- internal/paging/response.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'internal/paging/response.go') diff --git a/internal/paging/response.go b/internal/paging/response.go index 498b42d34..71b0cf213 100644 --- a/internal/paging/response.go +++ b/internal/paging/response.go @@ -18,6 +18,7 @@ package paging import ( + "net/url" "strings" apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model" @@ -35,18 +36,13 @@ type ResponseParams struct { Path string // path to use for next/prev queries in the link header Next *Page // page details for the next page Prev *Page // page details for the previous page - Query []string // any extra query parameters to provide in the link header, should be in the format 'example=value' + Query url.Values // any extra query parameters to provide in the link header, should be in the format 'example=value' } // PackageResponse is a convenience function for returning // a bunch of pageable items (notifications, statuses, etc), as well // as a Link header to inform callers of where to find next/prev items. func PackageResponse(params ResponseParams) *apimodel.PageableResponse { - if len(params.Items) == 0 { - // No items to page through. - return EmptyResponse() - } - var ( // Extract paging params. nextPg = params.Next -- cgit v1.2.3