adds update, adds way to disable email within forgotPassword operation

This commit is contained in:
James
2020-08-14 10:04:48 -04:00
parent 6c881e3c48
commit b53dbc1a27
14 changed files with 87 additions and 21 deletions

View File

@@ -91,15 +91,20 @@ const optionsToValidatorMap = {
return true;
},
richText: (value) => {
richText: (value, options) => {
//! Need better way to share an empty text node
//! it is used here and in field-types/RichText
const emptyRichTextNode = [{
children: [{ text: '' }],
}];
const blankSlateJSNode = JSON.stringify(emptyRichTextNode);
if (value && JSON.stringify(value) !== blankSlateJSNode) return true;
return 'This field is required.';
if (options.required) {
const blankSlateJSNode = JSON.stringify(emptyRichTextNode);
if (value && JSON.stringify(value) !== blankSlateJSNode) return true;
return 'This field is required.';
}
return true;
},
checkbox: (value, options = {}) => {
if ((value && typeof value !== 'boolean')