add: field listen_channel m_device

This commit is contained in:
2025-12-04 15:37:48 +07:00
parent 31daa470b7
commit 096fe9461d

View File

@@ -15,7 +15,8 @@ const insertDeviceSchema = Joi.object({
.required()
.messages({
'string.ip': 'IP address must be a valid IPv4 or IPv6 address'
})
}),
listen_channel: Joi.string().max(100).required()
});
const updateDeviceSchema = Joi.object({
@@ -28,11 +29,11 @@ const updateDeviceSchema = Joi.object({
.ip({ version: ['ipv4', 'ipv6'] })
.messages({
'string.ip': 'IP address must be a valid IPv4 or IPv6 address'
})
}),
listen_channel: Joi.string().max(100)
}).min(1);
// ✅ Export dengan CommonJS
module.exports = {
insertDeviceSchema, updateDeviceSchema
};