Archived
2

code improvements

This commit is contained in:
VLE2FE
2020-09-03 16:26:16 +02:00
parent 6ae49e9f09
commit 5744162220
11 changed files with 16 additions and 41 deletions

View File

@ -199,7 +199,6 @@ export default class SampleValidate {
data.filters[i] = decodeURIComponent(data.filters[i]);
}
catch (ignore) {}
console.log(data.filters[i]);
data.filters[i] = JSON.parse(data.filters[i]);
data.filters[i].values = data.filters[i].values.map(e => { // validate filter values
if (e === null) { // null values are always allowed
@ -241,7 +240,6 @@ export default class SampleValidate {
validator = Joi.object(this.sample);
}
const {value, error} = validator.validate({[field]: e});
console.log(error);
if (error) throw error; // reject invalid values
return value[field];
});

View File

@ -75,7 +75,7 @@ export default class UserValidate { // validate input for user
}).validate(data);
}
else {
return{error: 'No parameter specified!', value: {}};
return {error: 'No parameter specified!', value: {}};
}
}