Spaces:
Sleeping
Sleeping
File size: 485 Bytes
7f81110 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import { Request, Response, NextFunction } from "express";
import { ValidationError } from "../../../../domain/errors/ValidationError";
export const ValidationMiddleware = (schema: any) => {
return (req: Request, res: Response, next: NextFunction) => {
try {
// Mocking Zod validation
console.log("Validating request...");
next();
} catch (error: any) {
next(new ValidationError(error.message));
}
};
};
|