summaryrefslogtreecommitdiffstats
path: root/routers/web/org
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-08-12 14:43:08 +0200
committerGitHub <noreply@github.com>2021-08-12 14:43:08 +0200
commit2289580bb7ef8dfa4124c2b3bfb89897dbb35f46 (patch)
treee68aae604bb3d738b44156504a1415adaf042c68 /routers/web/org
parentca13e1d56c561f72cf8ad251fe61b1898abfec51 (diff)
downloadgitea-2289580bb7ef8dfa4124c2b3bfb89897dbb35f46.tar.gz
gitea-2289580bb7ef8dfa4124c2b3bfb89897dbb35f46.zip
[API] generalize list header (#16551)
* Add info about list endpoints to CONTRIBUTING.md * Let all list endpoints return X-Total-Count header * Add TODOs for GetCombinedCommitStatusByRef * Fix models/issue_stopwatch.go * Rrefactor models.ListDeployKeys * Introduce helper func and use them for SetLinkHeader related func
Diffstat (limited to 'routers/web/org')
-rw-r--r--routers/web/org/home.go4
-rw-r--r--routers/web/org/members.go4
-rw-r--r--routers/web/org/setting.go2
3 files changed, 5 insertions, 5 deletions
diff --git a/routers/web/org/home.go b/routers/web/org/home.go
index da53053c7f..0c1f381d30 100644
--- a/routers/web/org/home.go
+++ b/routers/web/org/home.go
@@ -107,7 +107,7 @@ func Home(ctx *context.Context) {
return
}
- var opts = models.FindOrgMembersOpts{
+ var opts = &models.FindOrgMembersOpts{
OrgID: org.ID,
PublicOnly: true,
ListOptions: models.ListOptions{Page: 1, PageSize: 25},
@@ -122,7 +122,7 @@ func Home(ctx *context.Context) {
opts.PublicOnly = !isMember && !ctx.User.IsAdmin
}
- members, _, err := models.FindOrgMembers(&opts)
+ members, _, err := models.FindOrgMembers(opts)
if err != nil {
ctx.ServerError("FindOrgMembers", err)
return
diff --git a/routers/web/org/members.go b/routers/web/org/members.go
index 2989637a61..84aaa28f60 100644
--- a/routers/web/org/members.go
+++ b/routers/web/org/members.go
@@ -31,7 +31,7 @@ func Members(ctx *context.Context) {
page = 1
}
- var opts = models.FindOrgMembersOpts{
+ var opts = &models.FindOrgMembersOpts{
OrgID: org.ID,
PublicOnly: true,
}
@@ -54,7 +54,7 @@ func Members(ctx *context.Context) {
pager := context.NewPagination(int(total), setting.UI.MembersPagingNum, page, 5)
opts.ListOptions.Page = page
opts.ListOptions.PageSize = setting.UI.MembersPagingNum
- members, membersIsPublic, err := models.FindOrgMembers(&opts)
+ members, membersIsPublic, err := models.FindOrgMembers(opts)
if err != nil {
ctx.ServerError("GetMembers", err)
return
diff --git a/routers/web/org/setting.go b/routers/web/org/setting.go
index b21b94d64d..7e6fc5bf4c 100644
--- a/routers/web/org/setting.go
+++ b/routers/web/org/setting.go
@@ -186,7 +186,7 @@ func Webhooks(ctx *context.Context) {
ctx.Data["BaseLinkNew"] = ctx.Org.OrgLink + "/settings/hooks"
ctx.Data["Description"] = ctx.Tr("org.settings.hooks_desc")
- ws, err := models.GetWebhooksByOrgID(ctx.Org.Organization.ID, models.ListOptions{})
+ ws, err := models.ListWebhooksByOpts(&models.ListWebhookOptions{OrgID: ctx.Org.Organization.ID})
if err != nil {
ctx.ServerError("GetWebhooksByOrgId", err)
return