cal.pub0.org/lib/helpers/extendRequest.ts

20 lines
589 B
TypeScript
Raw Normal View History

2022-06-06 16:17:10 +00:00
import type { IncomingMessage } from "http";
import { NextMiddleware } from "next-api-middleware";
import type { PrismaClient } from ".prisma/client";
/** @todo figure how to use the one from `@calcom/types`fi */
/** @todo: remove once `@calcom/types` is updated with it.*/
declare module "next" {
export interface NextApiRequest extends IncomingMessage {
userId: number;
method: string;
prisma: PrismaClient;
body: any;
query: { [key: string]: string | string[] };
}
}
export const extendRequest: NextMiddleware = async (req, res, next) => {
await next();
};