FIX: fixed condition of getObjValueFromPath

This commit is contained in:
Gabriel Rosa
2022-11-09 20:06:23 -03:00
parent abc6258492
commit 4a7e660a49
3 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -3279,7 +3279,7 @@
"info": {
"title": "Maestro - fix/pipeline-details-bug",
"description": "Documentation for Maestro gateway",
"version": "9.11.2022 - 19:28",
"version": "9.11.2022 - 20:4",
"contact": {}
},
"tags": [],
+6 -4
View File
@@ -84,7 +84,7 @@ export class ConnectorClientService implements OnModuleInit {
});
const responseParsed = JSON.parse(res.message);
const connectorErrors = responseParsed.items
.filter((i) => i.update._index === 'connector' && i.update.error)
.filter((i) => i.update._index === 'connectors' && i.update.error)
.map((i) => ({
id: i.update._id,
reason: i.update.error,
@@ -115,7 +115,8 @@ export class ConnectorClientService implements OnModuleInit {
}));
const connectorCreated = responseParsed.items
.filter(
(i) => i.update._index === 'connector' && i.update.result === 'created',
(i) =>
i.update._index === 'connectors' && i.update.result === 'created',
)
.map((i) => ({
id: i.update._id,
@@ -149,7 +150,8 @@ export class ConnectorClientService implements OnModuleInit {
}));
const connectorUpdated = responseParsed.items
.filter(
(i) => i.update._index === 'connector' && i.update.result === 'updated',
(i) =>
i.update._index === 'connectors' && i.update.result === 'updated',
)
.map((i) => ({
id: i.update._id,
@@ -183,7 +185,7 @@ export class ConnectorClientService implements OnModuleInit {
}));
const connectorNoop = responseParsed.items
.filter(
(i) => i.update._index === 'connector' && i.update.result === 'noop',
(i) => i.update._index === 'connectors' && i.update.result === 'noop',
)
.map((i) => ({
id: i.update._id,
+1 -1
View File
@@ -4,7 +4,7 @@ export function getObjValueFromPath<T>(data: { object: T; path: string }): T {
let value = JSON.parse(JSON.stringify(object));
for (const key of keys) {
if (value) value = value[key];
if (value != undefined) value = value[key];
}
return value;
}