diff --git a/packages/nocodb/src/models/Audit.ts b/packages/nocodb/src/models/Audit.ts index dcd05b2e7d..ecff185dc4 100644 --- a/packages/nocodb/src/models/Audit.ts +++ b/packages/nocodb/src/models/Audit.ts @@ -54,8 +54,8 @@ export default class Audit implements AuditType { project_id?: string; fk_model_id?: string; row_id?: string; - op_type?: (typeof opTypes)[number]; - op_sub_type?: (typeof opSubTypes)[number]; + op_type?: typeof opTypes[number]; + op_sub_type?: typeof opSubTypes[number]; status?: string; description?: string; details?: string; diff --git a/packages/nocodb/src/models/Base.ts b/packages/nocodb/src/models/Base.ts index 92f04e4d18..24ec88d9d0 100644 --- a/packages/nocodb/src/models/Base.ts +++ b/packages/nocodb/src/models/Base.ts @@ -30,7 +30,7 @@ export default class Base implements BaseType { id?: string; project_id?: string; alias?: string; - type?: (typeof DB_TYPES)[number]; + type?: typeof DB_TYPES[number]; is_meta?: BoolType; config?: string; inflection_column?: string; diff --git a/packages/nocodb/src/models/Filter.ts b/packages/nocodb/src/models/Filter.ts index 1c94b35352..8e2bef9e61 100644 --- a/packages/nocodb/src/models/Filter.ts +++ b/packages/nocodb/src/models/Filter.ts @@ -81,8 +81,8 @@ export default class Filter implements FilterType { fk_column_id?: string; fk_parent_id?: string; - comparison_op?: (typeof COMPARISON_OPS)[number]; - comparison_sub_op?: (typeof COMPARISON_SUB_OPS)[number]; + comparison_op?: typeof COMPARISON_OPS[number]; + comparison_sub_op?: typeof COMPARISON_SUB_OPS[number]; value?: string; diff --git a/packages/nocodb/src/models/Project.ts b/packages/nocodb/src/models/Project.ts index b062222f69..6e9b669623 100644 --- a/packages/nocodb/src/models/Project.ts +++ b/packages/nocodb/src/models/Project.ts @@ -63,7 +63,7 @@ export default class Project implements ProjectType { for (const base of project.bases) { await Base.createBase( { - type: base.config?.client as (typeof DB_TYPES)[number], + type: base.config?.client as typeof DB_TYPES[number], ...base, projectId, }, diff --git a/packages/nocodb/src/models/RollupColumn.ts b/packages/nocodb/src/models/RollupColumn.ts index 6655c9927b..660e55fc49 100644 --- a/packages/nocodb/src/models/RollupColumn.ts +++ b/packages/nocodb/src/models/RollupColumn.ts @@ -20,7 +20,7 @@ export default class RollupColumn implements RollupType { fk_column_id; fk_relation_column_id; fk_rollup_column_id; - rollup_function: (typeof ROLLUP_FUNCTIONS)[number]; + rollup_function: typeof ROLLUP_FUNCTIONS[number]; constructor(data: Partial) { Object.assign(this, data); diff --git a/packages/nocodb/src/services/bulk-data-alias.service.ts b/packages/nocodb/src/services/bulk-data-alias.service.ts index bf65ef44a6..0c56d243d1 100644 --- a/packages/nocodb/src/services/bulk-data-alias.service.ts +++ b/packages/nocodb/src/services/bulk-data-alias.service.ts @@ -24,7 +24,7 @@ export class BulkDataAliasService { async executeBulkOperation( param: PathParams & { operation: T; - options: Parameters<(typeof BaseModelSqlv2.prototype)[T]>; + options: Parameters; }, ) { const { model, view, base } = await this.getModelViewBase(param); diff --git a/packages/nocodb/src/services/users/users.service.ts b/packages/nocodb/src/services/users/users.service.ts index 6d1305173b..6332f4b1c5 100644 --- a/packages/nocodb/src/services/users/users.service.ts +++ b/packages/nocodb/src/services/users/users.service.ts @@ -51,7 +51,10 @@ export class UsersService { email: string; lastname: any; }) { - return this.metaService.metaInsert2(null, null, MetaTable.USERS, { ...param, email: param.email?.toLowerCase() }); + return this.metaService.metaInsert2(null, null, MetaTable.USERS, { + ...param, + email: param.email?.toLowerCase(), + }); } async registerNewUserIfAllowed({ diff --git a/packages/nocodb/src/version-upgrader/ncProjectUpgraderV2_0090000.ts b/packages/nocodb/src/version-upgrader/ncProjectUpgraderV2_0090000.ts index ea196f293c..5fa5774637 100644 --- a/packages/nocodb/src/version-upgrader/ncProjectUpgraderV2_0090000.ts +++ b/packages/nocodb/src/version-upgrader/ncProjectUpgraderV2_0090000.ts @@ -605,7 +605,7 @@ async function migrateProjectModels( const colBody: Partial = { title: columnMeta._cn, rollup_function: columnMeta.rl - .fn as (typeof ROLLUP_FUNCTIONS)[number], + .fn as typeof ROLLUP_FUNCTIONS[number], }; colBody.fk_rollup_column_id = diff --git a/packages/nocodb/tests/unit/factory/view.ts b/packages/nocodb/tests/unit/factory/view.ts index 578b156423..1a319aeeab 100644 --- a/packages/nocodb/tests/unit/factory/view.ts +++ b/packages/nocodb/tests/unit/factory/view.ts @@ -3,7 +3,10 @@ import request from 'supertest'; import Model from '../../../src/models/Model'; import View from '../../../src/models/View'; -const createView = async (context, {title, table, type}: {title: string, table: Model, type: ViewTypes}) => { +const createView = async ( + context, + { title, table, type }: { title: string; table: Model; type: ViewTypes }, +) => { const viewTypeStr = (type) => { switch (type) { case ViewTypes.GALLERY: @@ -26,13 +29,16 @@ const createView = async (context, {title, table, type}: {title: string, table: title, type, }); - if(response.status !== 200) { - throw new Error('createView',response.body.message); + if (response.status !== 200) { + throw new Error(response.body.message); } - const view = await View.getByTitleOrId({fk_model_id: table.id, titleOrId:title}) as View; + const view = (await View.getByTitleOrId({ + fk_model_id: table.id, + titleOrId: title, + })) as View; - return view -} + return view; +}; -export {createView} +export { createView };