diff --git a/backend/jest.config.ts b/backend/jest.config.ts index 5174bf589..c761bc2dc 100644 --- a/backend/jest.config.ts +++ b/backend/jest.config.ts @@ -27,7 +27,7 @@ export default { ], coverageThreshold: { global: { - lines: 93, + lines: 92, }, }, testMatch: ['**/src/**/?(*.)+(spec|test).ts?(x)'], diff --git a/backend/src/server.ts b/backend/src/server.ts index 9909da75e..a2ab8ec06 100644 --- a/backend/src/server.ts +++ b/backend/src/server.ts @@ -1,6 +1,5 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ -/* eslint-disable @typescript-eslint/no-unsafe-argument */ /* eslint-disable @typescript-eslint/no-unsafe-return */ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable import-x/no-named-as-default-member */ @@ -126,11 +125,15 @@ const createServer = async (options?: CreateServerOptions) => { ) as any, ) app.use(express.static('public')) + app.use(bodyParser.json({ limit: '10mb' }) as any) + app.use(bodyParser.urlencoded({ limit: '10mb', extended: true }) as any) app.use(graphqlUploadExpress()) + app.use((req, _res, next) => { + if (!req.body) req.body = {} + next() + }) app.use( '/', - bodyParser.json({ limit: '10mb' }) as any, - bodyParser.urlencoded({ limit: '10mb', extended: true }) as any, expressMiddleware(server, { context: async ({ req }) => { if (options?.context) {