diff options
author | 2024-02-01 12:45:02 +0000 | |
---|---|---|
committer | 2024-02-01 12:45:02 +0000 | |
commit | c13eb87ae73ac1ba78e22fd3a6fd547038cb23cb (patch) | |
tree | 8e518c7e9de86018b4e09aa26efa29f9964bec40 /internal/processing/account | |
parent | [feature] Try HTTP signature validation with and without query params for inc... (diff) | |
download | gotosocial-c13eb87ae73ac1ba78e22fd3a6fd547038cb23cb.tar.xz |
stop paged endpoints returning null for empty items (#2597)
Diffstat (limited to 'internal/processing/account')
-rw-r--r-- | internal/processing/account/block.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/processing/account/block.go b/internal/processing/account/block.go index 58b0328a4..49f81557d 100644 --- a/internal/processing/account/block.go +++ b/internal/processing/account/block.go @@ -151,6 +151,11 @@ func (p *Processor) BlocksGet( return util.EmptyPageableResponse(), nil } + // Get the lowest and highest + // ID values, used for paging. + lo := blocks[count-1].ID + hi := blocks[0].ID + items := make([]interface{}, 0, count) for _, block := range blocks { @@ -165,11 +170,6 @@ func (p *Processor) BlocksGet( items = append(items, account) } - // Get the lowest and highest - // ID values, used for paging. - lo := blocks[count-1].ID - hi := blocks[0].ID - return paging.PackageResponse(paging.ResponseParams{ Items: items, Path: "/api/v1/blocks", |