Browse Source

fix: missing formview column insert

pull/7477/head
Pranav C 11 months ago
parent
commit
3a405771c3
  1. 4
      packages/nocodb/src/meta/meta.service.ts
  2. 20
      packages/nocodb/src/models/View.ts

4
packages/nocodb/src/meta/meta.service.ts

@ -125,6 +125,10 @@ export class MetaService {
data: any | any[], data: any | any[],
ignoreIdGeneration?: boolean, ignoreIdGeneration?: boolean,
): Promise<any> { ): Promise<any> {
if (Array.isArray(data) ? !data.length : !data) {
return [];
}
const insertObj = []; const insertObj = [];
const at = this.now(); const at = this.now();

20
packages/nocodb/src/models/View.ts

@ -1639,6 +1639,8 @@ export default class View implements ViewType {
} }
} }
if (isSystemColumn(column)) show = false;
insertObjs.push({ insertObjs.push({
fk_column_id: column.id, fk_column_id: column.id,
order: order++, order: order++,
@ -1683,6 +1685,14 @@ export default class View implements ViewType {
insertObjs, insertObjs,
); );
break; break;
case ViewTypes.FORM:
await ncMeta.bulkMetaInsert(
null,
null,
MetaTable.FORM_VIEW_COLUMNS,
insertObjs,
);
break;
} }
} }
@ -1853,7 +1863,10 @@ export default class View implements ViewType {
); );
// populate view columns // populate view columns
await View.bulkColumnInsertToViews({ viewColumns, copyFromView }, insertedView); await View.bulkColumnInsertToViews(
{ viewColumns, copyFromView },
insertedView,
);
} else { } else {
// populate view columns // populate view columns
await View.bulkColumnInsertToViews( await View.bulkColumnInsertToViews(
@ -1862,6 +1875,11 @@ export default class View implements ViewType {
); );
} }
await Model.getNonDefaultViewsCountAndReset(
{ modelId: view.fk_model_id },
ncMeta,
);
return insertedView; return insertedView;
} }
} }

Loading…
Cancel
Save