Archived
2

added GET /sample/number/{number} route

This commit is contained in:
VLE2FE
2020-07-20 16:31:48 +02:00
parent cd81cbf4bd
commit 1a784ade85
7 changed files with 508 additions and 164 deletions

View File

@ -70,13 +70,14 @@ export default class SampleValidate {
private static fieldKeys = [
...SampleValidate.sortKeys,
'condition',
'notes',
'material_id',
'material',
'note_id',
'user_id',
'material._id',
'material.numbers',
'measurements.spectrum.dpt'
'measurements.spectrum.dpt',
];
static input (data, param) { // validate input, set param to 'new' to make all attributes required
@ -134,6 +135,7 @@ export default class SampleValidate {
material_id: IdValidate.get(),
material: MaterialValidate.outputV().append({number: Joi.string().max(128).allow('')}),
note_id: IdValidate.get().allow(null),
notes: this.sample.notes,
user_id: IdValidate.get(),
added: this.sample.added
};