Move team related functions to service layer (#32537)

There are still some functions under `models` after last big refactor
about `models`. This change will move all team related functions to
service layer with no code change.
This commit is contained in:
Lunny Xiao 2024-11-27 13:12:26 -08:00 committed by GitHub
parent 5a50b271e7
commit f62f68cbdd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 452 additions and 483 deletions

View file

@ -197,3 +197,8 @@ func TestUsersInTeamsCount(t *testing.T) {
test([]int64{1, 2, 3, 4, 5}, []int64{2, 5}, 2) // userid 2,4
test([]int64{1, 2, 3, 4, 5}, []int64{2, 3, 5}, 3) // userid 2,4,5
}
func TestIsUsableTeamName(t *testing.T) {
assert.NoError(t, organization.IsUsableTeamName("usable"))
assert.True(t, db.IsErrNameReserved(organization.IsUsableTeamName("new")))
}