separated groups and suppliers for material GET
This commit is contained in:
		@@ -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(),
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user