wisdom #2
@@ -26,7 +26,6 @@ const registerSchema = Joi.object({
|
|||||||
'string.pattern.name': 'Password must contain at least one {#name}'
|
'string.pattern.name': 'Password must contain at least one {#name}'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
const loginSchema = Joi.object({
|
const loginSchema = Joi.object({
|
||||||
email: Joi.string().email().required(),
|
email: Joi.string().email().required(),
|
||||||
password: Joi.string().required(),
|
password: Joi.string().required(),
|
||||||
@@ -51,8 +50,22 @@ const deviceSchema = Joi.object({
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const deviceUpdateSchema = Joi.object({
|
||||||
|
device_code: Joi.string().max(100),
|
||||||
|
device_name: Joi.string().max(100),
|
||||||
|
device_status: Joi.boolean(),
|
||||||
|
device_location: Joi.string().max(100),
|
||||||
|
device_description: Joi.string(),
|
||||||
|
ip_address: Joi.string()
|
||||||
|
.ip({ version: ['ipv4', 'ipv6'] })
|
||||||
|
.messages({
|
||||||
|
'string.ip': 'IP address must be a valid IPv4 or IPv6 address'
|
||||||
|
})
|
||||||
|
}).min(1);
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
registerSchema,
|
registerSchema,
|
||||||
loginSchema,
|
loginSchema,
|
||||||
deviceSchema
|
deviceSchema,
|
||||||
|
deviceUpdateSchema
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user