Archived
2

separated groups and suppliers for material GET

This commit is contained in:
VLE2FE
2020-05-28 17:05:23 +02:00
parent c7d25bd7cb
commit 14ba1655ba
13 changed files with 291 additions and 33 deletions

View File

@ -83,6 +83,16 @@ export default class MaterialValidate { // validate input for material
return error !== undefined? null : value;
}
static outputGroups (data) {// validate groups output and strip unwanted properties, returns null if not valid
const {value, error} = this.material.group.validate(data, {stripUnknown: true});
return error !== undefined? null : value;
}
static outputSuppliers (data) {// validate suppliers output and strip unwanted properties, returns null if not valid
const {value, error} = this.material.supplier.validate(data, {stripUnknown: true});
return error !== undefined? null : value;
}
static outputV() { // return output validator
return Joi.object({
_id: IdValidate.get(),