Browse Source

fix(nocodb): safeguard empty table name

pull/4401/head
Wing-Kam Wong 2 years ago
parent
commit
a5f2972aae
  1. 5
      packages/nocodb/src/lib/meta/api/tableApis.ts

5
packages/nocodb/src/lib/meta/api/tableApis.ts

@ -91,7 +91,10 @@ export async function tableCreate(req: Request<any, any, TableReqType>, res) {
const project = await Project.getWithInfo(req.params.projectId); const project = await Project.getWithInfo(req.params.projectId);
const base = project.bases[0]; const base = project.bases[0];
if (!req.body.table_name) { if (
!req.body.table_name ||
(project.prefix && project.prefix === req.body.table_name)
) {
NcError.badRequest( NcError.badRequest(
'Missing table name `table_name` property in request body' 'Missing table name `table_name` property in request body'
); );

Loading…
Cancel
Save