π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
fix incorrect system assignment
Fendy Heryantoff78b96c6abb
diff --git a/packages/nocodb/src/helpers/columnHelpers.ts b/packages/nocodb/src/helpers/columnHelpers.tsindex 7b4dc4fdbc..7ae3a8fc15 100644--- a/packages/nocodb/src/helpers/columnHelpers.ts+++ b/packages/nocodb/src/helpers/columnHelpers.ts@@ -652,7 +652,7 @@ export const TableSystemColumns = () => [title: 'Id',uidt: UITypes.ID,allowNonSystem: false,- system: true,+ system: false,},{column_name: 'created_at',@@ -666,6 +666,7 @@ export const TableSystemColumns = () => [title: 'UpdatedAt',uidt: UITypes.LastModifiedTime,allowNonSystem: true,+ system: true,},{column_name: 'created_by',diff --git a/packages/nocodb/src/services/tables.service.ts b/packages/nocodb/src/services/tables.service.tsindex 4ec362d72e..c1e6985b65 100644--- a/packages/nocodb/src/services/tables.service.ts+++ b/packages/nocodb/src/services/tables.service.ts@@ -644,6 +644,7 @@ export class TablesService {columns: tableCreatePayLoad.columns,});+ //#region validating table title and table nameif (!tableCreatePayLoad.title) {NcError.get(context).invalidRequestBody('Missing table `title` property in request body',@@ -748,16 +749,17 @@ export class TablesService {`Table name exceeds ${tableNameLengthLimit} characters`,);}+ //#endregion validating table title and table nameconst mxColumnLength = Column.getMaxColumnNameLength(sqlClientType);const uniqueColumnNameCount = {};- mapDefaultDisplayValue(param.table.columns);+ mapDefaultDisplayValue(tableCreatePayLoad.columns);const virtualColumns = [];- for (const column of param.table.columns) {+ for (const column of tableCreatePayLoad.columns) {if (!isVirtualCol(column) ||(isCreatedOrLastModifiedTimeCol(column) && (column as any).system) ||@@ -797,7 +799,7 @@ export class TablesService {}tableCreatePayLoad.columns = await Promise.all(- param.table.columns+ tableCreatePayLoad.columns// exclude alias columns from column list?.filter((c) => {const allowed =diff --git a/packages/nocodb/tests/unit/factory/table.ts b/packages/nocodb/tests/unit/factory/table.tsindex f813982abd..88563dc808 100644--- a/packages/nocodb/tests/unit/factory/table.ts+++ b/packages/nocodb/tests/unit/factory/table.ts@@ -42,7 +42,7 @@ const getTableMeta = async (context, table) => {.expect(200);return response.body;-}+};const getColumnsByAPI = async (context, base, table) => {const response = await request(context.app)