Archived
2

separated groups and suppliers for material PUT and POST

This commit is contained in:
VLE2FE
2020-05-29 10:40:17 +02:00
parent 14ba1655ba
commit 48b1a9da6e
4 changed files with 96 additions and 44 deletions

View File

@ -70,6 +70,8 @@ export default class MaterialValidate { // validate input for material
static output (data) { // validate output and strip unwanted properties, returns null if not valid
data = IdValidate.stringify(data);
data.group = data.group_id.name;
data.supplier = data.supplier_id.name;
const {value, error} = Joi.object({
_id: IdValidate.get(),
name: this.material.name,