Merge branch 'master' of github.com:trouble/payload into slate-js
This commit is contained in:
@@ -9,7 +9,7 @@ const validateUpdate = async (data, fields) => {
|
||||
|
||||
const field = fields.find(matchedField => matchedField.name === key);
|
||||
|
||||
if (field && dataToValidate) {
|
||||
if (field && dataToValidate !== undefined) {
|
||||
validationPromises.push(field.validate(dataToValidate, field));
|
||||
validatedFields.push(field);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,11 @@ const optionsToValidatorMap = {
|
||||
return `This value must be longer than the minimum length of ${options.max} characters.`;
|
||||
}
|
||||
|
||||
return Boolean(value);
|
||||
if (typeof value !== 'string' || value.length === 0) {
|
||||
return 'This field is required.';
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
password: (value, options = {}) => {
|
||||
if (options.maxLength && value.length > options.maxLength) {
|
||||
|
||||
Reference in New Issue
Block a user