import { NextFunction, Request, Response } from "express";

export const handleRequest =
  (controllerCreator: any) => (req: Request, res: Response, next: NextFunction) => {
    const context = res.locals["context"];
    return controllerCreator(context, req, res, next).execute(req, res, next);
  };
