From a986c10e37bc9f4d8aed688725e039bcb794015f Mon Sep 17 00:00:00 2001 From: Semjon Geist Date: Wed, 7 Dec 2022 16:53:43 +0100 Subject: [PATCH] Possible fix for API requests with wrong baseID ("undefined"). --- packages/nocodb/src/lib/meta/api/tableApis.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/src/lib/meta/api/tableApis.ts b/packages/nocodb/src/lib/meta/api/tableApis.ts index e9aa9442d3..32295c96f0 100644 --- a/packages/nocodb/src/lib/meta/api/tableApis.ts +++ b/packages/nocodb/src/lib/meta/api/tableApis.ts @@ -91,7 +91,7 @@ export async function tableCreate(req: Request, res) { const project = await Project.getWithInfo(req.params.projectId); let base = project.bases[0]; - if (req.params.baseId) { + if (req.params.baseId && req.params.baseId !== 'undefined') { base = project.bases.find((b) => b.id === req.params.baseId); } @@ -230,7 +230,7 @@ export async function tableUpdate(req: Request, res) { const project = await Project.getWithInfo(req.body.project_id); const base = project.bases.find((b) => b.id === model.base_id); - + if (!req.body.table_name) { NcError.badRequest( 'Missing table name `table_name` property in request body'