0
Fork 0
mirror of https://codeberg.org/SafeTwitch/safetwitch-backend.git synced 2024-12-22 13:13:00 -05:00

Pass cursor into function

This commit is contained in:
dragongoose 2023-07-29 21:04:52 -04:00
parent ed138fbe3e
commit af3a348d99
No known key found for this signature in database
GPG key ID: 01397EEC371CDAA5

View file

@ -11,7 +11,8 @@ func Routes(route *gin.Engine) {
auth := route.Group("/api/discover") auth := route.Group("/api/discover")
auth.GET("", func(context *gin.Context) { auth.GET("", func(context *gin.Context) {
data, err := twitch.GetDiscoveryPage(50, "") cursor := context.Query("cursor")
data, err := twitch.GetDiscoveryPage(50, cursor)
if err != nil { if err != nil {
context.Error(err) context.Error(err)
return return
@ -21,7 +22,8 @@ func Routes(route *gin.Engine) {
}) })
auth.GET("/:categoryName", func(context *gin.Context) { auth.GET("/:categoryName", func(context *gin.Context) {
data, err := twitch.GetDiscoveryItem(context.Param("categoryName"), 50, "") cursor := context.Query("cursor")
data, err := twitch.GetDiscoveryItem(context.Param("categoryName"), 50, cursor)
if err != nil { if err != nil {
context.Error(err) context.Error(err)
return return