Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

delete rather than set undefined

Fendy Heryanto7d0b91bd028c
diff --git a/packages/nocodb/src/helpers/tableHelpers.ts b/packages/nocodb/src/helpers/tableHelpers.ts
index 6b5783786b..2e6ffdfbea 100644
--- a/packages/nocodb/src/helpers/tableHelpers.ts
+++ b/packages/nocodb/src/helpers/tableHelpers.ts
@@ -52,23 +52,23 @@ export const repopulateCreateTableSystemColumns = (
{
// remove all properties not in documentations
- (col as any).dt = undefined;
- (col as any).np = undefined;
- (col as any).ns = undefined;
- (col as any).clen = undefined;
- (col as any).cop = undefined;
- (col as any).pk = undefined;
- (col as any).rqd = undefined;
- (col as any).un = undefined;
- (col as any).ai = undefined;
- (col as any).unique = undefined;
- (col as any).cc = undefined;
- (col as any).csn = undefined;
- (col as any).dtx = undefined;
- (col as any).dtxs = undefined;
- (col as any).au = undefined;
- (col as any).validate = undefined;
- (col as any).system = undefined;
+ delete (col as any).dt;
+ delete (col as any).np;
+ delete (col as any).ns;
+ delete (col as any).clen;
+ delete (col as any).cop;
+ delete (col as any).pk;
+ delete (col as any).rqd;
+ delete (col as any).un;
+ delete (col as any).ai;
+ delete (col as any).unique;
+ delete (col as any).cc;
+ delete (col as any).csn;
+ delete (col as any).dtx;
+ delete (col as any).dtxs;
+ delete (col as any).au;
+ delete (col as any).validate;
+ delete (col as any).system;
}
}
return result;
diff --git a/packages/nocodb/src/services/tables.service.ts b/packages/nocodb/src/services/tables.service.ts
index 118ed84fef..4ec362d72e 100644
--- a/packages/nocodb/src/services/tables.service.ts
+++ b/packages/nocodb/src/services/tables.service.ts
@@ -644,43 +644,6 @@ export class TablesService {
columns: tableCreatePayLoad.columns,
});
- {
- // set order of system columns in columns list
- const orderOfSystemColumns = [
- UITypes.ID,
- UITypes.CreatedTime,
- UITypes.LastModifiedTime,
- UITypes.CreatedBy,
- UITypes.LastModifiedBy,
- UITypes.Order,
- ];
-
- tableCreatePayLoad.columns = tableCreatePayLoad.columns.sort((a, b) => {
- const aIndex =
- a.system || a.uidt === UITypes.ID
- ? orderOfSystemColumns.indexOf(a.uidt as UITypes)
- : -1;
- const bIndex =
- b.system || b.uidt === UITypes.ID
- ? orderOfSystemColumns.indexOf(b.uidt as UITypes)
- : -1;
-
- if (aIndex === -1 && bIndex === -1) {
- return 0;
- }
-
- if (aIndex === -1) {
- return 1;
- }
-
- if (bIndex === -1) {
- return -1;
- }
-
- return aIndex - bIndex;
- });
- }
-
if (!tableCreatePayLoad.title) {
NcError.get(context).invalidRequestBody(
'Missing table `title` property in request body',