diff options
author | JakobDev <jakobdev@gmx.de> | 2023-10-11 06:24:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-11 04:24:07 +0000 |
commit | ebe803e514acb4eedc884226be2489ee6b4acd28 (patch) | |
tree | 3f4d38f8267142dcd0e8df7d76cd4fe04c47b85e /routers/api/v1/org | |
parent | 50166d1f7c6df41c79561b094e29c9698c0000d5 (diff) | |
download | gitea-ebe803e514acb4eedc884226be2489ee6b4acd28.tar.gz gitea-ebe803e514acb4eedc884226be2489ee6b4acd28.zip |
Penultimate round of `db.DefaultContext` refactor (#27414)
Part of #27065
---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'routers/api/v1/org')
-rw-r--r-- | routers/api/v1/org/avatar.go | 4 | ||||
-rw-r--r-- | routers/api/v1/org/team.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/routers/api/v1/org/avatar.go b/routers/api/v1/org/avatar.go index a7b5008525..7b621a50c3 100644 --- a/routers/api/v1/org/avatar.go +++ b/routers/api/v1/org/avatar.go @@ -43,7 +43,7 @@ func UpdateAvatar(ctx *context.APIContext) { return } - err = user_service.UploadAvatar(ctx.Org.Organization.AsUser(), content) + err = user_service.UploadAvatar(ctx, ctx.Org.Organization.AsUser(), content) if err != nil { ctx.Error(http.StatusInternalServerError, "UploadAvatar", err) } @@ -69,7 +69,7 @@ func DeleteAvatar(ctx *context.APIContext) { // "$ref": "#/responses/empty" // "404": // "$ref": "#/responses/notFound" - err := user_service.DeleteAvatar(ctx.Org.Organization.AsUser()) + err := user_service.DeleteAvatar(ctx, ctx.Org.Organization.AsUser()) if err != nil { ctx.Error(http.StatusInternalServerError, "DeleteAvatar", err) } diff --git a/routers/api/v1/org/team.go b/routers/api/v1/org/team.go index 9b68253623..f129c66230 100644 --- a/routers/api/v1/org/team.go +++ b/routers/api/v1/org/team.go @@ -638,7 +638,7 @@ func GetTeamRepo(ctx *context.APIContext) { // getRepositoryByParams get repository by a team's organization ID and repo name func getRepositoryByParams(ctx *context.APIContext) *repo_model.Repository { - repo, err := repo_model.GetRepositoryByName(ctx.Org.Team.OrgID, ctx.Params(":reponame")) + repo, err := repo_model.GetRepositoryByName(ctx, ctx.Org.Team.OrgID, ctx.Params(":reponame")) if err != nil { if repo_model.IsErrRepoNotExist(err) { ctx.NotFound() |