Add more check

This commit is contained in:
Lunny Xiao 2024-10-30 17:48:16 -07:00
parent d74263430f
commit ec8fbde2c7
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 5 additions and 0 deletions

View File

@ -224,6 +224,11 @@ func UpdateTeam(ctx context.Context, t *organization.Team, updateCols ...string)
return util.NewInvalidArgumentErrorf("empty team name")
}
if slices.Contains(updateCols, "name") && !slices.Contains(updateCols, "lower_name") {
t.LowerName = strings.ToLower(t.Name)
updateCols = append(updateCols, "lower_name")
}
authChanged := slices.Contains(updateCols, "authorize")
includeAllChanged := slices.Contains(updateCols, "includes_all_repositories")