Browse Source

Added space removal logic to table name on creation

pull/2553/head
Mustafa 2 years ago
parent
commit
a7607464b1
  1. 3
      packages/nocodb/src/lib/meta/api/tableApis.ts

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

@ -103,6 +103,9 @@ export async function tableCreate(req: Request<any, any, TableReqType>, res) {
} }
} }
// Cleanup table name
req.body.table_name = req.body.table_name.toLowerCase().replace(/ /g, '_');
// validate table name // validate table name
if (/^\s+|\s+$/.test(req.body.table_name)) { if (/^\s+|\s+$/.test(req.body.table_name)) {
NcError.badRequest( NcError.badRequest(

Loading…
Cancel
Save