From 17500c311197472776e04270e387678ce31f6e16 Mon Sep 17 00:00:00 2001 From: Ivan Florentin Date: Sat, 6 Aug 2016 10:32:44 -0400 Subject: [PATCH] error on the interface --- src/edit.js | 10 +++++++++- src/providers.js | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/edit.js b/src/edit.js index 2cebea3..0f26e08 100644 --- a/src/edit.js +++ b/src/edit.js @@ -18,12 +18,20 @@ export default function (compDef) { for (let fieldName of fieldNames) { const componentField = compDef.fields[fieldName] - const field = {next[fieldError]} + } + const field =
+ { next[fieldName] = e save() }}/> + {error} +
listFields.push(field) } diff --git a/src/providers.js b/src/providers.js index ac046a3..8176554 100644 --- a/src/providers.js +++ b/src/providers.js @@ -62,12 +62,14 @@ export default function (compDef) { const value = String(action.component[fieldName]) const validators = fields[fieldName].validate if (validators && validators.length > 0) { + let validatorPassed = true for (let validator of validators) { const valid = validator.func(value, validator.params) if (!valid) { next.isValid = false next[`${fieldName}Error`] = validator.message } + else {delete next[`${fieldName}Error`]} } } }