2024-05-10 13:36:04 -07:00
|
|
|
const joi = require("joi");
|
2024-05-10 13:59:33 -07:00
|
|
|
const user = require("../models/user");
|
2024-05-09 17:06:00 -04:00
|
|
|
|
2024-05-14 23:15:29 -04:00
|
|
|
const loginValidation = joi.object({
|
|
|
|
|
email: joi.string().email().required(),
|
|
|
|
|
password: joi.string().min(8).required(),
|
|
|
|
|
});
|
|
|
|
|
const registerValidation = joi.object({
|
|
|
|
|
firstname: joi.string().required(),
|
|
|
|
|
lastname: joi.string().required(),
|
2024-05-10 13:36:04 -07:00
|
|
|
email: joi.string().email().required(),
|
|
|
|
|
password: joi.string().min(8).required(),
|
2024-05-09 17:06:00 -04:00
|
|
|
});
|
|
|
|
|
|
2024-05-10 13:36:04 -07:00
|
|
|
const getMonitorsByIdValidation = joi.object({
|
|
|
|
|
monitorId: joi.string().required(),
|
|
|
|
|
});
|
2024-05-09 17:06:00 -04:00
|
|
|
|
2024-05-10 13:59:33 -07:00
|
|
|
const getMonitorsByUserIdValidation = joi.object({
|
|
|
|
|
userId: joi.string().required(),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
2024-05-14 23:15:29 -04:00
|
|
|
loginValidation,
|
|
|
|
|
registerValidation,
|
2024-05-10 13:59:33 -07:00
|
|
|
getMonitorsByIdValidation,
|
|
|
|
|
getMonitorsByUserIdValidation,
|
|
|
|
|
};
|