diff --git a/src/functions/item/__tests__/get.test.js b/src/functions/item/__tests__/get.test.js index 7a6a607..cdf724a 100644 --- a/src/functions/item/__tests__/get.test.js +++ b/src/functions/item/__tests__/get.test.js @@ -5,10 +5,7 @@ import { handler } from "../get"; describe("GET Item", () => { it("requires path parameter ID", async () => { - const response = await handler({ - headers: { "Content-Type": "application/json" }, - body: null, - }); + const response = await handler({}); expect(response).toStrictEqual({ statusCode: 400, diff --git a/src/functions/item/get.ts b/src/functions/item/get.ts index 0224816..1fd347e 100644 --- a/src/functions/item/get.ts +++ b/src/functions/item/get.ts @@ -1,6 +1,5 @@ import middy from "@middy/core"; import httpErrorHandler from "@middy/http-error-handler"; -import httpJsonBodyParser from "@middy/http-json-body-parser"; import { APIGatewayProxyEventV2, Handler } from "aws-lambda"; import { z } from "zod"; @@ -31,5 +30,4 @@ const getItemHandler: Handler = async (event) => { export const handler = middy() .use(httpErrorHandler({ logger: false })) - .use(httpJsonBodyParser()) .handler(getItemHandler); diff --git a/src/functions/list/__tests__/get.test.js b/src/functions/list/__tests__/get.test.js index 0817e25..558fdeb 100644 --- a/src/functions/list/__tests__/get.test.js +++ b/src/functions/list/__tests__/get.test.js @@ -5,10 +5,7 @@ import { handler } from "../get"; describe("GET List", () => { it("requires path parameter ID", async () => { - const response = await handler({ - headers: { "Content-Type": "application/json" }, - body: null, - }); + const response = await handler({}); expect(response).toStrictEqual({ statusCode: 400, diff --git a/src/functions/list/get.ts b/src/functions/list/get.ts index 4539933..0981851 100644 --- a/src/functions/list/get.ts +++ b/src/functions/list/get.ts @@ -1,6 +1,5 @@ import middy from "@middy/core"; import httpErrorHandler from "@middy/http-error-handler"; -import httpJsonBodyParser from "@middy/http-json-body-parser"; import { APIGatewayProxyEventV2, Handler } from "aws-lambda"; import { z } from "zod"; @@ -29,5 +28,4 @@ const getListHandler: Handler = async (event) => { export const handler = middy() .use(httpErrorHandler({ logger: false })) - .use(httpJsonBodyParser()) .handler(getListHandler);