summaryrefslogtreecommitdiff
path: root/internal/api/client/timelines/list.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/client/timelines/list.go')
-rw-r--r--internal/api/client/timelines/list.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/internal/api/client/timelines/list.go b/internal/api/client/timelines/list.go
index b02489d6c..2e89f16ea 100644
--- a/internal/api/client/timelines/list.go
+++ b/internal/api/client/timelines/list.go
@@ -23,6 +23,7 @@ import (
"github.com/gin-gonic/gin"
apiutil "github.com/superseriousbusiness/gotosocial/internal/api/util"
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
+ "github.com/superseriousbusiness/gotosocial/internal/paging"
)
// ListTimelineGETHandler swagger:operation GET /api/v1/timelines/list/{id} listTimeline
@@ -131,7 +132,11 @@ func (m *Module) ListTimelineGETHandler(c *gin.Context) {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
}
- limit, errWithCode := apiutil.ParseLimit(c.Query(apiutil.LimitKey), 20, 40, 1)
+ page, errWithCode := paging.ParseIDPage(c,
+ 1, // min limit
+ 40, // max limit
+ 20, // default limit
+ )
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
@@ -139,12 +144,9 @@ func (m *Module) ListTimelineGETHandler(c *gin.Context) {
resp, errWithCode := m.processor.Timeline().ListTimelineGet(
c.Request.Context(),
- authed,
+ authed.Account,
targetListID,
- c.Query(apiutil.MaxIDKey),
- c.Query(apiutil.SinceIDKey),
- c.Query(apiutil.MinIDKey),
- limit,
+ page,
)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)