update
This commit is contained in:
@ -110,7 +110,7 @@ export class UnitController {
|
||||
|
||||
var query = await UnitModel.list(filter);
|
||||
const data = await query.getMany();
|
||||
|
||||
|
||||
const filename = "unit.csv";
|
||||
|
||||
res.setHeader('Content-Type', 'text/csv');
|
||||
@ -173,6 +173,8 @@ export class UnitController {
|
||||
try {
|
||||
const schema = Joi.object().keys({
|
||||
unit_name: Joi.string().max(256).required().label('Name'),
|
||||
small_unit: Joi.string().max(256).optional().allow('').label('Small Unit'),
|
||||
large_unit: Joi.string().max(256).optional().allow('').label('Large Unit'),
|
||||
});
|
||||
|
||||
const param: any = await schema.validateAsync(req.body);
|
||||
@ -223,6 +225,8 @@ export class UnitController {
|
||||
const schema = Joi.object().keys({
|
||||
id: Joi.string().uuid().required().label('ID'),
|
||||
unit_name: Joi.string().max(256).required().label('Name'),
|
||||
small_unit: Joi.string().max(256).optional().allow('').label('Small Unit'),
|
||||
large_unit: Joi.string().max(256).optional().allow('').label('Large Unit'),
|
||||
});
|
||||
|
||||
req.body.id = req.params['id'];
|
||||
|
||||
Reference in New Issue
Block a user