mirror of
https://github.com/go-gitea/gitea
synced 2025-07-19 08:48:37 +00:00
Fix create team, update team missing units (#5188)
This commit is contained in:
committed by
techknowlogick
parent
d487a76ee2
commit
b3000ae623
@@ -4,6 +4,10 @@
|
||||
|
||||
package models
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// UnitType is Unit's Type
|
||||
type UnitType int
|
||||
|
||||
@@ -137,3 +141,16 @@ var (
|
||||
UnitTypeExternalWiki: UnitExternalWiki,
|
||||
}
|
||||
)
|
||||
|
||||
// FindUnitTypes give the unit key name and return unit
|
||||
func FindUnitTypes(nameKeys ...string) (res []UnitType) {
|
||||
for _, key := range nameKeys {
|
||||
for t, u := range Units {
|
||||
if strings.EqualFold(key, u.NameKey) {
|
||||
res = append(res, t)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user