diff options
author | 2023-09-07 15:58:37 +0100 | |
---|---|---|
committer | 2023-09-07 15:58:37 +0100 | |
commit | b093947d84127789e5a3a662a9e11d0b9438180e (patch) | |
tree | eec3be2f1594599bee3db90e737431708101ae45 /internal/api | |
parent | [feature] Support OTLP HTTP, drop Jaeger (#2184) (diff) | |
download | gotosocial-b093947d84127789e5a3a662a9e11d0b9438180e.tar.xz |
[chore] much improved paging package (#2182)
Diffstat (limited to 'internal/api')
-rw-r--r-- | internal/api/client/blocks/blocksget.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/api/client/blocks/blocksget.go b/internal/api/client/blocks/blocksget.go index 505c33db8..dcf70e9cf 100644 --- a/internal/api/client/blocks/blocksget.go +++ b/internal/api/client/blocks/blocksget.go @@ -103,8 +103,12 @@ func (m *Module) BlocksGETHandler(c *gin.Context) { return } - limit, errWithCode := apiutil.ParseLimit(c.Query(LimitKey), 20, 100, 2) - if err != nil { + page, errWithCode := paging.ParseIDPage(c, + 1, // min limit + 100, // max limit + 20, // default limit + ) + if errWithCode != nil { apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) return } @@ -112,11 +116,7 @@ func (m *Module) BlocksGETHandler(c *gin.Context) { resp, errWithCode := m.processor.BlocksGet( c.Request.Context(), authed.Account, - paging.Pager{ - SinceID: c.Query(SinceIDKey), - MaxID: c.Query(MaxIDKey), - Limit: limit, - }, + page, ) if errWithCode != nil { apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) |