diff options
Diffstat (limited to 'internal/api/client/timelines/home.go')
| -rw-r--r-- | internal/api/client/timelines/home.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/internal/api/client/timelines/home.go b/internal/api/client/timelines/home.go index 8e957d498..4cb0ae8aa 100644 --- a/internal/api/client/timelines/home.go +++ b/internal/api/client/timelines/home.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" ) // HomeTimelineGETHandler swagger:operation GET /api/v1/timelines/home homeTimeline @@ -127,13 +128,17 @@ func (m *Module) HomeTimelineGETHandler(c *gin.Context) { return } - limit, errWithCode := apiutil.ParseLimit(c.Query(apiutil.LimitKey), 20, 40, 1) + local, errWithCode := apiutil.ParseLocal(c.Query(apiutil.LocalKey), false) if errWithCode != nil { apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) return } - local, errWithCode := apiutil.ParseLocal(c.Query(apiutil.LocalKey), false) + 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 @@ -141,11 +146,8 @@ func (m *Module) HomeTimelineGETHandler(c *gin.Context) { resp, errWithCode := m.processor.Timeline().HomeTimelineGet( c.Request.Context(), - authed, - c.Query(apiutil.MaxIDKey), - c.Query(apiutil.SinceIDKey), - c.Query(apiutil.MinIDKey), - limit, + authed.Account, + page, local, ) if errWithCode != nil { |
