fixes: events mapping for versioning: queries and components

This commit is contained in:
arpitnath 2023-10-04 11:31:35 +05:30
parent 085134dc72
commit 9c73b44002

View file

@ -680,17 +680,6 @@ export class AppsService {
);
newQuery.options = newOptions;
const newQueryEvents = await manager.find(EventHandler, {
where: { appVersionId: appVersion.id, sourceId: newQuery.id },
});
const updatedEvents = this.replaceDataQueryEventActionWithNewDataQueryIds(
newQueryEvents,
oldDataQueryToNewMapping
);
await manager.save(updatedEvents);
await manager.save(newQuery);
}
@ -721,6 +710,7 @@ export class AppsService {
}
}
}
console.log('---------arpit:: motherIndea', { oldDataQueryToNewMapping });
return oldDataQueryToNewMapping;
}
@ -750,19 +740,6 @@ export class AppsService {
return options;
}
replaceDataQueryEventActionWithNewDataQueryIds(events: EventHandler[], dataQueryMapping) {
if (events) {
const replacedEvents = events.map((event) => {
if (event.event.queryId) {
event.event.queryId = dataQueryMapping[event.event.queryId];
}
return event;
});
return replacedEvents;
}
}
replaceDataQueryIdWithinDefinitions(definition, dataQueryMapping) {
if (definition?.pages) {
for (const pageId of Object.keys(definition?.pages)) {