|
|
|
@ -4,6 +4,7 @@ import xcMetaDiff, {
|
|
|
|
|
XcMetaDiffType |
|
|
|
|
} from '../../meta/handlers/xcMetaDiff'; |
|
|
|
|
import XcCache from '../../plugins/adapters/cache/XcCache'; |
|
|
|
|
import { GqlApiBuilder } from '../../gql/GqlApiBuilder'; |
|
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
export default async function(this: BaseApiBuilder<any> | any) { |
|
|
|
@ -198,11 +199,11 @@ export default async function(this: BaseApiBuilder<any> | any) {
|
|
|
|
|
|
|
|
|
|
/* update sort field */ |
|
|
|
|
/* const sIndex = (sortList || []).findIndex( |
|
|
|
|
v => v.field === oldColumn._cn |
|
|
|
|
); |
|
|
|
|
if (sIndex > -1) { |
|
|
|
|
sortList.splice(sIndex, 1); |
|
|
|
|
}*/ |
|
|
|
|
v => v.field === oldColumn._cn |
|
|
|
|
); |
|
|
|
|
if (sIndex > -1) { |
|
|
|
|
sortList.splice(sIndex, 1); |
|
|
|
|
}*/ |
|
|
|
|
for (const sort of sortList || []) { |
|
|
|
|
if ( |
|
|
|
|
sort?.field === oldColumn.cn || |
|
|
|
@ -220,12 +221,12 @@ export default async function(this: BaseApiBuilder<any> | any) {
|
|
|
|
|
/* update filters */ |
|
|
|
|
// todo: remove only corresponding filter and compare field name
|
|
|
|
|
/* if ( |
|
|
|
|
filters && |
|
|
|
|
(JSON.stringify(filters)?.includes(`"${oldColumn.cn}"`) || |
|
|
|
|
JSON.stringify(filters)?.includes(`"${oldColumn._cn}"`)) |
|
|
|
|
) { |
|
|
|
|
filters.splice(0, filters.length); |
|
|
|
|
}*/ |
|
|
|
|
filters && |
|
|
|
|
(JSON.stringify(filters)?.includes(`"${oldColumn.cn}"`) || |
|
|
|
|
JSON.stringify(filters)?.includes(`"${oldColumn._cn}"`)) |
|
|
|
|
) { |
|
|
|
|
filters.splice(0, filters.length); |
|
|
|
|
}*/ |
|
|
|
|
for (const filter of filters) { |
|
|
|
|
if ( |
|
|
|
|
filter?.field === oldColumn.cn || |
|
|
|
@ -319,8 +320,8 @@ export default async function(this: BaseApiBuilder<any> | any) {
|
|
|
|
|
db_type: this.connectionConfig?.client |
|
|
|
|
// todo: get these info
|
|
|
|
|
/* dr: , |
|
|
|
|
ur: onUpdate, |
|
|
|
|
fkn*/ |
|
|
|
|
ur: onUpdate, |
|
|
|
|
fkn*/ |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
populateParams.tableNames.push({ tn: change.tn }); |
|
|
|
@ -647,11 +648,11 @@ export default async function(this: BaseApiBuilder<any> | any) {
|
|
|
|
|
|
|
|
|
|
/* update sort field */ |
|
|
|
|
/* const sIndex = (sortList || []).findIndex( |
|
|
|
|
v => v.field === oldColumn._cn |
|
|
|
|
); |
|
|
|
|
if (sIndex > -1) { |
|
|
|
|
sortList.splice(sIndex, 1); |
|
|
|
|
}*/ |
|
|
|
|
v => v.field === oldColumn._cn |
|
|
|
|
); |
|
|
|
|
if (sIndex > -1) { |
|
|
|
|
sortList.splice(sIndex, 1); |
|
|
|
|
}*/ |
|
|
|
|
for (const sort of sortList || []) { |
|
|
|
|
if ( |
|
|
|
|
sort?.field === oldColumn.cn || |
|
|
|
@ -669,12 +670,12 @@ export default async function(this: BaseApiBuilder<any> | any) {
|
|
|
|
|
/* update filters */ |
|
|
|
|
// todo: remove only corresponding filter and compare field name
|
|
|
|
|
/* if ( |
|
|
|
|
filters && |
|
|
|
|
(JSON.stringify(filters)?.includes(`"${oldColumn.cn}"`) || |
|
|
|
|
JSON.stringify(filters)?.includes(`"${oldColumn._cn}"`)) |
|
|
|
|
) { |
|
|
|
|
filters.splice(0, filters.length); |
|
|
|
|
}*/ |
|
|
|
|
filters && |
|
|
|
|
(JSON.stringify(filters)?.includes(`"${oldColumn.cn}"`) || |
|
|
|
|
JSON.stringify(filters)?.includes(`"${oldColumn._cn}"`)) |
|
|
|
|
) { |
|
|
|
|
filters.splice(0, filters.length); |
|
|
|
|
}*/ |
|
|
|
|
for (const filter of filters) { |
|
|
|
|
if ( |
|
|
|
|
filter?.field === oldColumn.cn || |
|
|
|
@ -769,6 +770,10 @@ export default async function(this: BaseApiBuilder<any> | any) {
|
|
|
|
|
await this.xcTablesPopulate(populateParams); |
|
|
|
|
await this.xcTablesPopulate(populateViewsParams); |
|
|
|
|
|
|
|
|
|
if (this instanceof GqlApiBuilder) { |
|
|
|
|
await (this as GqlApiBuilder).reInitializeGraphqlEndpoint(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return populateParams; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|