Browse Source

refactor: make only title as required

pull/9660/head
Pranav C 1 month ago
parent
commit
9ec0baec9a
  1. 2
      packages/nc-gui/utils/columnUtils.ts
  2. 3
      packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.controller.ts
  3. 8
      packages/nocodb/src/schema/swagger-v2.json
  4. 9
      packages/nocodb/src/schema/swagger.json
  5. 16
      packages/nocodb/src/services/tables.service.ts

2
packages/nc-gui/utils/columnUtils.ts

@ -289,7 +289,7 @@ const checkboxIconList = [
},
]
export const ratingIconList = [
const ratingIconList = [
{
full: 'mdi-star',
empty: 'mdi-star-outline',

3
packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.controller.ts

@ -194,6 +194,7 @@ export class DuplicateController {
@Param('modelId') modelId?: string,
@Body()
body?: {
title?: string;
options?: {
excludeData?: boolean;
excludeViews?: boolean;
@ -226,7 +227,7 @@ export class DuplicateController {
const models = await source.getModels(context);
const uniqueTitle = generateUniqueName(
`${model.title} copy`,
body.title || `${model.title} copy`,
models.map((p) => p.title),
);

8
packages/nocodb/src/schema/swagger-v2.json

@ -3883,6 +3883,11 @@
"excludeHooks": {
"type": "boolean",
"required": false
},
"title": {
"type": "string",
"required": false,
"description": "New table title"
}
}
}
@ -20568,7 +20573,6 @@
}
},
"required": [
"table_name",
"title"
],
"x-stoplight": {
@ -20839,7 +20843,7 @@
},
"required": [
"columns",
"table_name"
"title"
],
"title": "Table Request Model",
"type": "object",

9
packages/nocodb/src/schema/swagger.json

@ -4489,6 +4489,11 @@
"excludeHooks": {
"type": "boolean",
"required": false
},
"title": {
"type": "string",
"required": false,
"description": "New table title"
}
}
}
@ -25625,7 +25630,7 @@
}
},
"required": [
"table_name",
"title",
"title"
],
"x-stoplight": {
@ -25905,7 +25910,7 @@
},
"required": [
"columns",
"table_name"
"title"
],
"title": "Table Request Model",
"type": "object",

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

@ -558,18 +558,12 @@ export class TablesService {
}
}
if (
!tableCreatePayLoad.title
) {
NcError.badRequest(
'Missing table `title` property in request body',
);
if (!tableCreatePayLoad.title) {
NcError.badRequest('Missing table `title` property in request body');
}
if(!tableCreatePayLoad.table_name) {
if (!tableCreatePayLoad.table_name) {
tableCreatePayLoad.table_name = tableCreatePayLoad.title;
}
if (
@ -623,8 +617,6 @@ export class TablesService {
);
}
const sqlMgr = await ProjectMgrv2.getSqlMgr(context, base);
const sqlClient = await NcConnectionMgrv2.getSqlClient(source);

Loading…
Cancel
Save