|
|
|
@ -2,11 +2,12 @@ import { Injectable } from '@nestjs/common';
|
|
|
|
|
import DOMPurify from 'isomorphic-dompurify'; |
|
|
|
|
import { |
|
|
|
|
AuditOperationSubTypes, |
|
|
|
|
AuditOperationTypes, isLinksOrLTAR, |
|
|
|
|
AuditOperationTypes, |
|
|
|
|
isLinksOrLTAR, |
|
|
|
|
isVirtualCol, |
|
|
|
|
ModelTypes, |
|
|
|
|
UITypes, |
|
|
|
|
} from 'nocodb-sdk' |
|
|
|
|
} from 'nocodb-sdk'; |
|
|
|
|
import { T } from 'nc-help'; |
|
|
|
|
import ProjectMgrv2 from '../db/sql-mgr/v2/ProjectMgrv2'; |
|
|
|
|
import { NcError } from '../helpers/catchError'; |
|
|
|
@ -14,13 +15,7 @@ import getColumnPropsFromUIDT from '../helpers/getColumnPropsFromUIDT';
|
|
|
|
|
import getColumnUiType from '../helpers/getColumnUiType'; |
|
|
|
|
import getTableNameAlias, { getColumnNameAlias } from '../helpers/getTableName'; |
|
|
|
|
import mapDefaultDisplayValue from '../helpers/mapDefaultDisplayValue'; |
|
|
|
|
import { |
|
|
|
|
Audit, |
|
|
|
|
Column, |
|
|
|
|
Model, |
|
|
|
|
ModelRoleVisibility, |
|
|
|
|
Project, |
|
|
|
|
} from '../models'; |
|
|
|
|
import { Audit, Column, Model, ModelRoleVisibility, Project } from '../models'; |
|
|
|
|
import Noco from '../Noco'; |
|
|
|
|
import NcConnectionMgrv2 from '../utils/common/NcConnectionMgrv2'; |
|
|
|
|
import { validatePayload } from '../helpers'; |
|
|
|
@ -156,9 +151,7 @@ export class TablesService {
|
|
|
|
|
const project = await Project.getWithInfo(table.project_id); |
|
|
|
|
const base = project.bases.find((b) => b.id === table.base_id); |
|
|
|
|
|
|
|
|
|
const relationColumns = table.columns.filter( |
|
|
|
|
(c) => isLinksOrLTAR(c), |
|
|
|
|
); |
|
|
|
|
const relationColumns = table.columns.filter((c) => isLinksOrLTAR(c)); |
|
|
|
|
|
|
|
|
|
if (relationColumns?.length && !base.is_meta) { |
|
|
|
|
const referredTables = await Promise.all( |
|
|
|
|