mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-11 13:37:29 -06:00
fix up more tests, fix missing required changes, etc
This commit is contained in:
parent
61f8da707c
commit
64564496f1
10 changed files with 130 additions and 84 deletions
|
|
@ -66,8 +66,8 @@ func (p *Processor) getStatusTimeline(
|
|||
requester *gtsmodel.Account,
|
||||
timeline *timeline.StatusTimeline,
|
||||
page *paging.Page,
|
||||
pgPath string, // timeline page path
|
||||
pgQuery url.Values, // timeline query parameters
|
||||
pagePath string,
|
||||
pageQuery url.Values,
|
||||
filterCtx statusfilter.FilterContext,
|
||||
loadPage func(*paging.Page) (statuses []*gtsmodel.Status, err error),
|
||||
preFilter func(*gtsmodel.Status) (bool, error),
|
||||
|
|
@ -153,12 +153,17 @@ func (p *Processor) getStatusTimeline(
|
|||
return nil, gtserror.WrapWithCode(http.StatusInternalServerError, err)
|
||||
}
|
||||
|
||||
// Check for empty response.
|
||||
if len(apiStatuses) == 0 {
|
||||
return paging.EmptyResponse(), nil
|
||||
}
|
||||
|
||||
// Package returned API statuses as pageable response.
|
||||
return paging.PackageResponse(paging.ResponseParams{
|
||||
Items: xslices.ToAny(apiStatuses),
|
||||
Path: pgPath,
|
||||
Path: pagePath,
|
||||
Next: page.Next(lo, hi),
|
||||
Prev: page.Prev(lo, hi),
|
||||
Query: pgQuery,
|
||||
Query: pageQuery,
|
||||
}), nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue