mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 10:12:26 -05:00
[feature] add paging to account follows, followers and follow requests endpoints (#2186)
This commit is contained in:
parent
4b594516ec
commit
7293d6029b
51 changed files with 2281 additions and 641 deletions
|
|
@ -38,7 +38,7 @@ func (f *federatingDB) Followers(ctx context.Context, actorIRI *url.URL) (follow
|
|||
return nil, err
|
||||
}
|
||||
|
||||
follows, err := f.state.DB.GetAccountFollowers(ctx, acct.ID)
|
||||
follows, err := f.state.DB.GetAccountFollowers(ctx, acct.ID, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Followers: db error getting followers for account id %s: %s", acct.ID, err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ func (f *federatingDB) Following(ctx context.Context, actorIRI *url.URL) (follow
|
|||
return nil, err
|
||||
}
|
||||
|
||||
follows, err := f.state.DB.GetAccountFollows(ctx, acct.ID)
|
||||
follows, err := f.state.DB.GetAccountFollows(ctx, acct.ID, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Following: db error getting following for account id %s: %w", acct.ID, err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ func (suite *FollowingTestSuite) TestGetFollowing() {
|
|||
suite.Equal(`{
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"items": [
|
||||
"http://localhost:8080/users/admin",
|
||||
"http://localhost:8080/users/1happyturtle"
|
||||
"http://localhost:8080/users/1happyturtle",
|
||||
"http://localhost:8080/users/admin"
|
||||
],
|
||||
"type": "Collection"
|
||||
}`, string(fJson))
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ func (f *federatingDB) InboxesForIRI(c context.Context, iri *url.URL) (inboxIRIs
|
|||
return nil, fmt.Errorf("couldn't find local account with username %s: %s", localAccountUsername, err)
|
||||
}
|
||||
|
||||
follows, err := f.state.DB.GetAccountFollowers(c, account.ID)
|
||||
follows, err := f.state.DB.GetAccountFollowers(c, account.ID, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("couldn't get followers of local account %s: %s", localAccountUsername, err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue