diff --git a/lib/src/validators/user.dart b/lib/src/validators/user.dart index 9080ce7f..e094496b 100644 --- a/lib/src/validators/user.dart +++ b/lib/src/validators/user.dart @@ -1,7 +1,10 @@ import 'package:angel_validate/angel_validate.dart'; -final Validator CREATE_USER = new Validator({ - 'email*': [isString, isEmail], - 'username*': [isString, isNotEmpty], - 'password*': [isString, isNotEmpty] +final Validator USER = new Validator({ + 'email': [isString, isNotEmpty, isEmail], + 'username': [isString, isNotEmpty], + 'password': [isString, isNotEmpty] }); + +final Validator CREATE_USER = USER.extend({}) + ..requiredFields.addAll(['email', 'username', 'password']);