diff --git a/apps/api/v2/src/middleware/body/json.body.middleware.ts b/apps/api/v2/src/middleware/body/json.body.middleware.ts index 8f454090cf..242353bea7 100644 --- a/apps/api/v2/src/middleware/body/json.body.middleware.ts +++ b/apps/api/v2/src/middleware/body/json.body.middleware.ts @@ -1,10 +1,10 @@ import { Injectable, NestMiddleware } from "@nestjs/common"; -import * as bodyParser from "body-parser"; +import { json } from "body-parser"; import type { Request, Response } from "express"; @Injectable() export class JsonBodyMiddleware implements NestMiddleware { - use(req: Request, res: Response, next: () => any) { - bodyParser.json()(req, res, next); + use(req: Request, res: Response, next: () => any): void { + json()(req, res, next); } } diff --git a/apps/api/v2/src/middleware/body/raw.body.middleware.ts b/apps/api/v2/src/middleware/body/raw.body.middleware.ts index 6cdae2f617..6b3406d1a4 100644 --- a/apps/api/v2/src/middleware/body/raw.body.middleware.ts +++ b/apps/api/v2/src/middleware/body/raw.body.middleware.ts @@ -1,10 +1,10 @@ import { Injectable, NestMiddleware } from "@nestjs/common"; -import * as bodyParser from "body-parser"; +import { raw } from "body-parser"; import type { Request, Response } from "express"; @Injectable() export class RawBodyMiddleware implements NestMiddleware { - use(req: Request, res: Response, next: () => any) { - bodyParser.raw({ type: "*/*" })(req, res, next); + use(req: Request, res: Response, next: () => any): void { + raw({ type: "*/*" })(req, res, next); } } diff --git a/apps/api/v2/src/modules/auth/oauth2/controllers/oauth2.controller.e2e-spec.ts b/apps/api/v2/src/modules/auth/oauth2/controllers/oauth2.controller.e2e-spec.ts index 83dba9f116..4a823fd29b 100644 --- a/apps/api/v2/src/modules/auth/oauth2/controllers/oauth2.controller.e2e-spec.ts +++ b/apps/api/v2/src/modules/auth/oauth2/controllers/oauth2.controller.e2e-spec.ts @@ -4,7 +4,7 @@ import { AccessScope, OAuthClientType } from "@calcom/prisma/enums"; import { INestApplication } from "@nestjs/common"; import { NestExpressApplication } from "@nestjs/platform-express"; import { Test, TestingModule } from "@nestjs/testing"; -import * as nextAuthJwt from "next-auth/jwt"; +import { getToken } from "next-auth/jwt"; import request from "supertest"; import { MembershipRepositoryFixture } from "test/fixtures/repository/membership.repository.fixture"; import { OAuth2ClientRepositoryFixture } from "test/fixtures/repository/oauth2-client.repository.fixture"; @@ -24,7 +24,7 @@ import { UsersModule } from "@/modules/users/users.module"; jest.mock("next-auth/jwt", () => ({ getToken: jest.fn(), })); -const mockGetToken = nextAuthJwt.getToken as jest.MockedFunction; +const mockGetToken = getToken as jest.MockedFunction; describe("OAuth2 Controller Endpoints", () => { describe("User Not Authenticated", () => {