mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
stop paged endpoints returning null for empty items (#2597)
This commit is contained in:
@@ -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",
|
||||
|
Reference in New Issue
Block a user