Browse Source

refactor: make title mandatory instead of table_name

pull/9660/head
Pranav C 1 month ago
parent
commit
1ea35f1f6d
  1. 31
      packages/nocodb/src/services/tables.service.ts

31
packages/nocodb/src/services/tables.service.ts

@ -558,15 +558,30 @@ export class TablesService {
}
}
if (
!tableCreatePayLoad.table_name ||
(base.prefix && base.prefix === tableCreatePayLoad.table_name)
!tableCreatePayLoad.title
) {
NcError.badRequest(
'Missing table name `table_name` property in request body',
'Missing table `title` property in request body',
);
}
if(!tableCreatePayLoad.table_name) {
}
if (
!(await Model.checkAliasAvailable(context, {
title: tableCreatePayLoad.title,
base_id: base.id,
source_id: source.id,
}))
) {
NcError.badRequest('Duplicate table alias');
}
if (source.type === 'databricks') {
tableCreatePayLoad.table_name = tableCreatePayLoad.table_name
.replace(/\s/g, '_')
@ -608,15 +623,7 @@ export class TablesService {
);
}
if (
!(await Model.checkAliasAvailable(context, {
title: tableCreatePayLoad.title,
base_id: base.id,
source_id: source.id,
}))
) {
NcError.badRequest('Duplicate table alias');
}
const sqlMgr = await ProjectMgrv2.getSqlMgr(context, base);

Loading…
Cancel
Save