Skip to content

Commit

Permalink
show doi form errors in console. #280
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Jan 5, 2020
1 parent 5c92477 commit 8b18e76
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/helpers/form-has-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ export function formHasErrors([ model ]) {
});
}

if (invalidModel) {
model.validations.errors.forEach((error) => {
console.log(`Invalid ${error.attribute}.`);
});
}
if (invalidTitle) {
console.log('Invalid title.');
}
if (invalidCreator) {
console.log('Invalid creator.');
}

return invalidModel || invalidTitle || invalidCreator;
}

Expand Down

0 comments on commit 8b18e76

Please sign in to comment.