fix(orchestration): filter out undefined items (#9046)
This commit is contained in:
@@ -92,7 +92,18 @@ export class RemoteJoiner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static getNestedItems(items: any[], property: string): any[] {
|
private static getNestedItems(items: any[], property: string): any[] {
|
||||||
return items.flatMap((item) => item?.[property])
|
const result: unknown[] = []
|
||||||
|
for (const item of items) {
|
||||||
|
const allValues = item?.[property] ?? []
|
||||||
|
const values = Array.isArray(allValues) ? allValues : [allValues]
|
||||||
|
for (const value of values) {
|
||||||
|
if (isDefined(value)) {
|
||||||
|
result.push(value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
private static createRelatedDataMap(
|
private static createRelatedDataMap(
|
||||||
@@ -377,7 +388,11 @@ export class RemoteJoiner {
|
|||||||
const isObj = isDefined(response.path)
|
const isObj = isDefined(response.path)
|
||||||
let resData = isObj ? response.data[response.path!] : response.data
|
let resData = isObj ? response.data[response.path!] : response.data
|
||||||
|
|
||||||
resData = Array.isArray(resData) ? resData : [resData]
|
resData = isDefined(resData)
|
||||||
|
? Array.isArray(resData)
|
||||||
|
? resData
|
||||||
|
: [resData]
|
||||||
|
: []
|
||||||
|
|
||||||
this.checkIfKeysExist(
|
this.checkIfKeysExist(
|
||||||
uniqueIds,
|
uniqueIds,
|
||||||
|
|||||||
Reference in New Issue
Block a user