diff options
author | JakobDev <jakobdev@gmx.de> | 2023-10-03 12:30:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-03 10:30:41 +0000 |
commit | cc5df266808361c1dd3a1d17cbba712826a93d7e (patch) | |
tree | f77c59a61d3dc36f07b5b84596e4a1cde12b55cc /routers/api/v1/org/org.go | |
parent | 08507e2760638124d75774c29ef37e692a88c02d (diff) | |
download | gitea-cc5df266808361c1dd3a1d17cbba712826a93d7e.tar.gz gitea-cc5df266808361c1dd3a1d17cbba712826a93d7e.zip |
Even more `db.DefaultContext` refactor (#27352)
Part of #27065
---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Diffstat (limited to 'routers/api/v1/org/org.go')
-rw-r--r-- | routers/api/v1/org/org.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/routers/api/v1/org/org.go b/routers/api/v1/org/org.go index c5f531923b..2594e4afbb 100644 --- a/routers/api/v1/org/org.go +++ b/routers/api/v1/org/org.go @@ -30,12 +30,12 @@ func listUserOrgs(ctx *context.APIContext, u *user_model.User) { UserID: u.ID, IncludePrivate: showPrivate, } - orgs, err := organization.FindOrgs(opts) + orgs, err := organization.FindOrgs(ctx, opts) if err != nil { ctx.Error(http.StatusInternalServerError, "FindOrgs", err) return } - maxResults, err := organization.CountOrgs(opts) + maxResults, err := organization.CountOrgs(ctx, opts) if err != nil { ctx.Error(http.StatusInternalServerError, "CountOrgs", err) return @@ -145,7 +145,7 @@ func GetUserOrgsPermissions(ctx *context.APIContext) { } org := organization.OrgFromUser(o) - authorizeLevel, err := org.GetOrgUserMaxAuthorizeLevel(ctx.ContextUser.ID) + authorizeLevel, err := org.GetOrgUserMaxAuthorizeLevel(ctx, ctx.ContextUser.ID) if err != nil { ctx.Error(http.StatusInternalServerError, "GetOrgUserAuthorizeLevel", err) return @@ -164,7 +164,7 @@ func GetUserOrgsPermissions(ctx *context.APIContext) { op.IsOwner = true } - op.CanCreateRepository, err = org.CanCreateOrgRepo(ctx.ContextUser.ID) + op.CanCreateRepository, err = org.CanCreateOrgRepo(ctx, ctx.ContextUser.ID) if err != nil { ctx.Error(http.StatusInternalServerError, "CanCreateOrgRepo", err) return @@ -268,7 +268,7 @@ func Create(ctx *context.APIContext) { Visibility: visibility, RepoAdminChangeTeamAccess: form.RepoAdminChangeTeamAccess, } - if err := organization.CreateOrganization(org, ctx.Doer); err != nil { + if err := organization.CreateOrganization(ctx, org, ctx.Doer); err != nil { if user_model.IsErrUserAlreadyExist(err) || db.IsErrNameReserved(err) || db.IsErrNameCharsNotAllowed(err) || @@ -429,7 +429,7 @@ func ListOrgActivityFeeds(ctx *context.APIContext) { includePrivate = true } else { org := organization.OrgFromUser(ctx.ContextUser) - isMember, err := org.IsOrgMember(ctx.Doer.ID) + isMember, err := org.IsOrgMember(ctx, ctx.Doer.ID) if err != nil { ctx.Error(http.StatusInternalServerError, "IsOrgMember", err) return |