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/api/client/blocks/blocksget.go | 43 ++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 14 deletions(-) (limited to 'internal/api/client/blocks') diff --git a/internal/api/client/blocks/blocksget.go b/internal/api/client/blocks/blocksget.go index dcf70e9cf..0761160bc 100644 --- a/internal/api/client/blocks/blocksget.go +++ b/internal/api/client/blocks/blocksget.go @@ -47,25 +47,40 @@ import ( // // parameters: // - -// name: limit -// type: integer -// description: Number of blocks to return. -// default: 20 -// in: query -// - // name: max_id // type: string // description: >- -// Return only blocks *OLDER* than the given block ID. -// The block with the specified ID will not be included in the response. +// Return only blocked accounts *OLDER* than the given max ID. +// The blocked account with the specified ID will not be included in the response. +// NOTE: the ID is of the internal block, NOT any of the returned accounts. // in: query +// required: false // - // name: since_id // type: string // description: >- -// Return only blocks *NEWER* than the given block ID. -// The block with the specified ID will not be included in the response. +// Return only blocked accounts *NEWER* than the given since ID. +// The blocked account with the specified ID will not be included in the response. +// NOTE: the ID is of the internal block, NOT any of the returned accounts. +// in: query +// - +// name: min_id +// type: string +// description: >- +// Return only blocked accounts *IMMEDIATELY NEWER* than the given min ID. +// The blocked account with the specified ID will not be included in the response. +// NOTE: the ID is of the internal block, NOT any of the returned accounts. +// in: query +// required: false +// - +// name: limit +// type: integer +// description: Number of blocked accounts to return. +// default: 40 +// minimum: 1 +// maximum: 80 // in: query +// required: false // // security: // - OAuth2 Bearer: @@ -104,16 +119,16 @@ func (m *Module) BlocksGETHandler(c *gin.Context) { } page, errWithCode := paging.ParseIDPage(c, - 1, // min limit - 100, // max limit - 20, // default limit + 1, // min limit + 80, // max limit + 40, // default limit ) if errWithCode != nil { apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) return } - resp, errWithCode := m.processor.BlocksGet( + resp, errWithCode := m.processor.Account().BlocksGet( c.Request.Context(), authed.Account, page, -- cgit v1.3