import { check } from "express-validator";
import { validateResult } from "../utils/handlers/validator.handle";

export const validateLogin = [
  check("email").exists().notEmpty(),
  check("password").exists().notEmpty(),
  (req, res, next) => {
    validateResult(req, res, next);
  },
];

export const validateRegister = [
  (req, res, next) => {
    console.log(req.body);
    next();
  },
  // check("name").exists().notEmpty(),
  // check("age").exists().notEmpty().isNumeric(),
  check("email").exists().notEmpty().isEmail(),
  check("password").exists().notEmpty().isLength({ min: 8, max: 15 }),
  (req, res, next) => {
    validateResult(req, res, next);
  },
];
