Skip to content

Commit e3028d1

Browse files
thehowllunny
authored andcommitted
don't reset team/repo count when updating team via API (#3831)
fixes #3600
1 parent fc36567 commit e3028d1

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

routers/api/v1/org/team.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,10 @@ func EditTeam(ctx *context.APIContext, form api.EditTeamOption) {
123123
// responses:
124124
// "200":
125125
// "$ref": "#/responses/Team"
126-
team := &models.Team{
127-
ID: ctx.Org.Team.ID,
128-
OrgID: ctx.Org.Team.OrgID,
129-
Name: form.Name,
130-
Description: form.Description,
131-
Authorize: models.ParseAccessMode(form.Permission),
132-
}
126+
team := ctx.Org.Team
127+
team.Name = form.Name
128+
team.Description = form.Description
129+
team.Authorize = models.ParseAccessMode(form.Permission)
133130
if err := models.UpdateTeam(team, true); err != nil {
134131
ctx.Error(500, "EditTeam", err)
135132
return

0 commit comments

Comments
 (0)