const createOrdersUserDataValidationError
    = require("../../../utils/customErrors/createOrdersUserDataValidationError");
import {createOrdersByUnregisterUserSchema} from
        "../../../utils/schemasYup/createOrdersByUnregisterUserSchema";

module.exports = async (req, res, next) => {

    if( await createOrdersByUnregisterUserSchema.isValid(req.body.userData) ) {
        next();
    }else {
        next(new createOrdersUserDataValidationError());
    }

};