summaryrefslogtreecommitdiff
path: root/internal/api/client/timeline/public.go
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-07-09 18:32:48 +0200
committerLibravatar GitHub <noreply@github.com>2021-07-09 18:32:48 +0200
commitc7da64922f8b41daaee1cb8fc2961f7fa1336737 (patch)
treeb1f9c946bd223267f87f2a77a7455974d8d5e5e9 /internal/api/client/timeline/public.go
parentDocs (#94) (diff)
downloadgotosocial-c7da64922f8b41daaee1cb8fc2961f7fa1336737.tar.xz
favourites GET implementation (#95)
Diffstat (limited to 'internal/api/client/timeline/public.go')
-rw-r--r--internal/api/client/timeline/public.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/api/client/timeline/public.go b/internal/api/client/timeline/public.go
index f4b233064..6898d781b 100644
--- a/internal/api/client/timeline/public.go
+++ b/internal/api/client/timeline/public.go
@@ -81,12 +81,15 @@ func (m *Module) PublicTimelineGETHandler(c *gin.Context) {
local = i
}
- statuses, errWithCode := m.processor.PublicTimelineGet(authed, maxID, sinceID, minID, limit, local)
+ resp, errWithCode := m.processor.PublicTimelineGet(authed, maxID, sinceID, minID, limit, local)
if errWithCode != nil {
- l.Debugf("error from processor account statuses get: %s", errWithCode)
+ l.Debugf("error from processor PublicTimelineGet: %s", errWithCode)
c.JSON(errWithCode.Code(), gin.H{"error": errWithCode.Safe()})
return
}
- c.JSON(http.StatusOK, statuses)
+ if resp.LinkHeader != "" {
+ c.Header("Link", resp.LinkHeader)
+ }
+ c.JSON(http.StatusOK, resp.Statuses)
}