fix: validation in sparepart and device
This commit is contained in:
@@ -19,6 +19,9 @@ const insertDeviceSchema = Joi.object({
|
||||
listen_channel: Joi.string().max(100).required(),
|
||||
listen_channel_reminder: Joi.string().max(100).allow('', null),
|
||||
reminder_at: Joi.date().iso().allow('', null),
|
||||
reminder_at_monthly: Joi.date().iso().allow('', null),
|
||||
start_date: Joi.date().iso().allow('', null),
|
||||
end_date: Joi.date().iso().allow('', null),
|
||||
});
|
||||
|
||||
const updateDeviceSchema = Joi.object({
|
||||
@@ -35,6 +38,9 @@ const updateDeviceSchema = Joi.object({
|
||||
listen_channel: Joi.string().max(100),
|
||||
listen_channel_reminder: Joi.string().max(100).allow('', null),
|
||||
reminder_at: Joi.date().iso().allow('', null),
|
||||
reminder_at_monthly: Joi.date().iso().allow('', null),
|
||||
start_date: Joi.date().iso().allow('', null),
|
||||
end_date: Joi.date().iso().allow('', null),
|
||||
|
||||
}).min(1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user