Skip to content
Snippets Groups Projects
Commit c31ca053 authored by Sandro Lutz's avatar Sandro Lutz
Browse files

Add validate to JSONSchemaForm

parent 119238d1
No related branches found
No related tags found
1 merge request!28Events
......@@ -9,6 +9,7 @@ import JSONSchemaForm from './jsonSchemaForm';
class EventSignupForm extends JSONSchemaForm {
oninit(vnode) {
super.oninit(vnode);
this.email = '';
this.emailErrors = [];
this.emailValid = false;
if (isLoggedIn()) {
......
......@@ -70,6 +70,12 @@ export default class JSONSchemaForm {
return this.schema === undefined || this.valid;
}
validate() {
// validate the new data against the schema
const validate = this.ajv.getSchema('schema');
this.valid = validate(this.data);
}
getValue() {
return this.data;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment