only allowed latest template version and allowed admin to set sample number
This commit is contained in:
@ -67,6 +67,17 @@ export default class SampleValidate {
|
||||
notes: this.sample.notes,
|
||||
}).validate(data);
|
||||
}
|
||||
else if (param === 'new-admin') {
|
||||
return Joi.object({
|
||||
number: this.sample.number.required(),
|
||||
color: this.sample.color.required(),
|
||||
type: this.sample.type.required(),
|
||||
batch: this.sample.batch.required(),
|
||||
condition: this.sample.condition.required(),
|
||||
material_id: IdValidate.get().required(),
|
||||
notes: this.sample.notes.required()
|
||||
}).validate(data);
|
||||
}
|
||||
else {
|
||||
return{error: 'No parameter specified!', value: {}};
|
||||
}
|
||||
|
Reference in New Issue
Block a user