Permalink
Browse files

fix(renderer): fix result format

  • Loading branch information...
RWOverdijk committed Feb 17, 2017
1 parent 99f1ef7 commit d230694fe1125ba35892753a7c0f87cffd608aba
Showing with 11 additions and 6 deletions.
  1. +11 −6 src/ValidationRenderer.js
@@ -26,11 +26,16 @@ export class ValidationRenderer {
/**
* Get form group.
*
* @param {string} propertyName
* @param {string} propertyName
* @param {boolean} [valid]
*
* @returns {*}
*/
getGroup({propertyName}) {
getGroup({propertyName, valid}) {
if (valid) {
return;
}
let group = this.groups[propertyName];
if (!group) {
@@ -64,12 +69,12 @@ export class ValidationRenderer {
* @param {{render: {}, unrender: {}}} instructions
*/
render(instructions) {
for (let {error} of instructions.unrender) {
this.remove(error);
for (let {result} of instructions.unrender) {
this.remove(result);
}
for (let {error} of instructions.render) {
this.add(error);
for (let {result} of instructions.render) {
this.add(result);
}
}
}

0 comments on commit d230694

Please sign in to comment.