feat: expose owner_name in coder_workspace resource (#11639)

This commit is contained in:
Marcin Tojek
2024-01-17 13:20:45 +01:00
committed by GitHub
parent b173195e0d
commit 5eb3e1cdaa
40 changed files with 353 additions and 146 deletions

View File

@ -80,6 +80,20 @@ func init() {
if err != nil {
panic(err)
}
userRealNameValidator := func(fl validator.FieldLevel) bool {
f := fl.Field().Interface()
str, ok := f.(string)
if !ok {
return false
}
valid := UserRealNameValid(str)
return valid == nil
}
err = Validate.RegisterValidation("user_real_name", userRealNameValidator)
if err != nil {
panic(err)
}
}
// Is404Error returns true if the given error should return a 404 status code.