Browse Source

fix: meta sync filter/sort bug

remove filter/sort option if column removed

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/914/head
Pranav C 3 years ago
parent
commit
63daad202b
  1. 4
      packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts
  2. 12
      packages/nocodb/src/lib/noco/common/handlers/xcMetaDiffSync.ts

4
packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts

@ -3178,6 +3178,10 @@ export default abstract class BaseApiBuilder<T extends Noco>
virtualViewsParamsArr,
virtualViews
);
await this.metaQueryParamsUpdate(queryParams, tableName);
}
private async metaQueryParamsUpdate(queryParams: any, tableName: string) {
await this.xcMeta.metaUpdate(
this.projectId,
this.dbAlias,

12
packages/nocodb/src/lib/noco/common/handlers/xcMetaDiffSync.ts

@ -180,7 +180,7 @@ export default async function(this: BaseApiBuilder<any> | any) {
const oldColumn = oldMeta.columns.find(c => c.cn === change?.cn);
const {
// virtualViews,
virtualViews,
virtualViewsParamsArr
// @ts-ignore
} = await this.extractSharedAndVirtualViewsParams(tn);
@ -256,6 +256,14 @@ export default async function(this: BaseApiBuilder<any> | any) {
}
}
// todo: enable
await this.updateSharedAndVirtualViewsParams(
virtualViewsParamsArr,
virtualViews
);
await this.metaQueryParamsUpdate(queryParams, tn);
// Delete lookup columns mapping to current column
// update column name in belongs to
if (oldMeta.belongsTo?.length) {
@ -354,7 +362,7 @@ export default async function(this: BaseApiBuilder<any> | any) {
)?._cn;
// virtual views param update
for (const qp of virtualViewsParamsArr) {
for (const qp of [virtualViewsParamsArr]) {
// @ts-ignore
const {
showFields = {},

Loading…
Cancel
Save