From fa4af13e58f15dd2e794b8596262bcc83dcddbe3 Mon Sep 17 00:00:00 2001 From: mike10911 Date: Wed, 24 Jan 2024 20:00:12 -0500 Subject: [PATCH] increase next body parser limit --- next.config.js | 3 +++ pages/api/v1/applicants/index.ts | 7 +++++++ pages/api/v1/registration.ts | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/next.config.js b/next.config.js index 0d607100..4bb592ab 100644 --- a/next.config.js +++ b/next.config.js @@ -1,3 +1,6 @@ module.exports = { reactStrictMode: true, + serverActions: { + bodySizeLimit: '3mb' + } } diff --git a/pages/api/v1/applicants/index.ts b/pages/api/v1/applicants/index.ts index f700b234..5e269341 100644 --- a/pages/api/v1/applicants/index.ts +++ b/pages/api/v1/applicants/index.ts @@ -67,5 +67,12 @@ function parseSort(queryString: string | string[]): any { // sort may not be stable, so sort by email as well return { [field]: sort.order === 'ascend' ? 1 : -1, email: -1 }; } +export const config = { + api: { + bodyParser: { + sizeLimit: '3mb' + } + } +} export default protect(handler); diff --git a/pages/api/v1/registration.ts b/pages/api/v1/registration.ts index b1f82646..eb8030d3 100644 --- a/pages/api/v1/registration.ts +++ b/pages/api/v1/registration.ts @@ -150,4 +150,12 @@ const patchHandler: NextApiHandler = async (req, res) => { return res.status(200).send(undefined); }; +export const config = { + api: { + bodyParser: { + sizeLimit: '3mb' + } + } +} + export default protect(registrationHandler);