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[],
ignoreIdGeneration?: boolean,
): Promise<any> {
if (Array.isArray(data) ? !data.length : !data) {
return [];
}
const insertObj = [];
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({
fk_column_id: column.id,
order: order++,
@ -1683,6 +1685,14 @@ export default class View implements ViewType {
insertObjs,
);
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
await View.bulkColumnInsertToViews({ viewColumns, copyFromView }, insertedView);
await View.bulkColumnInsertToViews(
{ viewColumns, copyFromView },
insertedView,
);
} else {
// populate view columns
await View.bulkColumnInsertToViews(
@ -1862,6 +1875,11 @@ export default class View implements ViewType {
);
}
await Model.getNonDefaultViewsCountAndReset(
{ modelId: view.fk_model_id },
ncMeta,
);
return insertedView;
}
}

Loading…
Cancel
Save