summaryrefslogtreecommitdiff
path: root/internal/api/client/account/statuses.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-06-08 20:22:49 +0200
committerLibravatar GitHub <noreply@github.com>2022-06-08 20:22:49 +0200
commit6f6e89e2715c9ecbadda6b8dbe5227995348dae8 (patch)
treeda867633cdd72981460baf76615a81ab3390ce9c /internal/api/client/account/statuses.go
parent[frontend] linkify header mascot+title (#633) (diff)
downloadgotosocial-6f6e89e2715c9ecbadda6b8dbe5227995348dae8.tar.xz
[feature] Add paging via `Link` header for notifications and account statuses (#629)
* test link headers * page get account statuses properly * page get notifications * add util func for packaging timeline responses * return timelined stuff from accountstatusesget * rename timeline response * use new convenience function * go fmt
Diffstat (limited to 'internal/api/client/account/statuses.go')
-rw-r--r--internal/api/client/account/statuses.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/api/client/account/statuses.go b/internal/api/client/account/statuses.go
index b440e582a..18b551fcc 100644
--- a/internal/api/client/account/statuses.go
+++ b/internal/api/client/account/statuses.go
@@ -222,12 +222,15 @@ func (m *Module) AccountStatusesGETHandler(c *gin.Context) {
publicOnly = i
}
- statuses, errWithCode := m.processor.AccountStatusesGet(c.Request.Context(), authed, targetAcctID, limit, excludeReplies, excludeReblogs, maxID, minID, pinnedOnly, mediaOnly, publicOnly)
+ resp, errWithCode := m.processor.AccountStatusesGet(c.Request.Context(), authed, targetAcctID, limit, excludeReplies, excludeReblogs, maxID, minID, pinnedOnly, mediaOnly, publicOnly)
if errWithCode != nil {
l.Debugf("error from processor account statuses get: %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.Items)
}