summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorMorgan Bazalgette <git@howl.moe>2018-04-29 07:22:57 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2018-04-29 13:22:57 +0800
commite3028d124f864b0ed2563cd0fea8b24612eb64bb (patch)
treea994b834bb1ca5eb8902f3fb7569422ff1c930f6 /routers
parentfc36567ee1e0a3ee7aa450161af2ae9149ecffc3 (diff)
downloadgitea-e3028d124f864b0ed2563cd0fea8b24612eb64bb.tar.gz
gitea-e3028d124f864b0ed2563cd0fea8b24612eb64bb.zip
don't reset team/repo count when updating team via API (#3831)
fixes #3600
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/org/team.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/routers/api/v1/org/team.go b/routers/api/v1/org/team.go
index b999d62aa1..408d8921db 100644
--- a/routers/api/v1/org/team.go
+++ b/routers/api/v1/org/team.go
@@ -123,13 +123,10 @@ func EditTeam(ctx *context.APIContext, form api.EditTeamOption) {
// responses:
// "200":
// "$ref": "#/responses/Team"
- team := &models.Team{
- ID: ctx.Org.Team.ID,
- OrgID: ctx.Org.Team.OrgID,
- Name: form.Name,
- Description: form.Description,
- Authorize: models.ParseAccessMode(form.Permission),
- }
+ team := ctx.Org.Team
+ team.Name = form.Name
+ team.Description = form.Description
+ team.Authorize = models.ParseAccessMode(form.Permission)
if err := models.UpdateTeam(team, true); err != nil {
ctx.Error(500, "EditTeam", err)
return