forked from forgejo/forgejo
Support pagination of organizations on user settings pages (#16083)
* Add pagination for user setting orgs * Use FindOrgs instead of GetOrgsByUserID * Remove unnecessary functions and fix test * remove unnecessary code
This commit is contained in:
parent
ed23a6c397
commit
c2ab19888f
7 changed files with 108 additions and 34 deletions
|
@ -167,9 +167,12 @@ func Profile(ctx *context.Context) {
|
|||
|
||||
showPrivate := ctx.IsSigned && (ctx.User.IsAdmin || ctx.User.ID == ctxUser.ID)
|
||||
|
||||
orgs, err := models.GetOrgsByUserID(ctxUser.ID, showPrivate)
|
||||
orgs, err := models.FindOrgs(models.FindOrgOptions{
|
||||
UserID: ctxUser.ID,
|
||||
IncludePrivate: showPrivate,
|
||||
})
|
||||
if err != nil {
|
||||
ctx.ServerError("GetOrgsByUserIDDesc", err)
|
||||
ctx.ServerError("FindOrgs", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue