diff options
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) |