mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 00:32:26 -05:00
[bugfix] Fix paging for empty items (#2236)
* use minID properly for public timeline * return paged response properly even when 0 items * use gtserror * page more consistently (for now) * test * aaa
This commit is contained in:
parent
736cd37caf
commit
2b6b9cdf83
7 changed files with 75 additions and 62 deletions
|
|
@ -48,11 +48,6 @@ type PageableResponseParams struct {
|
|||
// a bunch of pageable items (notifications, statuses, etc), as well
|
||||
// as a Link header to inform callers of where to find next/prev items.
|
||||
func PackagePageableResponse(params PageableResponseParams) (*apimodel.PageableResponse, gtserror.WithCode) {
|
||||
if len(params.Items) == 0 {
|
||||
// No items to page through.
|
||||
return EmptyPageableResponse(), nil
|
||||
}
|
||||
|
||||
// Set default paging values, if
|
||||
// they weren't set by the caller.
|
||||
if params.NextMaxIDKey == "" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue