From 4a7e660a49355792d3d5f795173a66fe5f01f114 Mon Sep 17 00:00:00 2001 From: Gabriel Rosa Date: Wed, 9 Nov 2022 20:06:23 -0300 Subject: [PATCH] FIX: fixed condition of getObjValueFromPath --- docsfera.json | 2 +- src/modules/connector/client.service.ts | 10 ++++++---- src/utils/ObjValueFromPath.ts | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docsfera.json b/docsfera.json index 77f7d96..950e6af 100644 --- a/docsfera.json +++ b/docsfera.json @@ -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": [], diff --git a/src/modules/connector/client.service.ts b/src/modules/connector/client.service.ts index 45143ef..fdd1cdb 100644 --- a/src/modules/connector/client.service.ts +++ b/src/modules/connector/client.service.ts @@ -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, diff --git a/src/utils/ObjValueFromPath.ts b/src/utils/ObjValueFromPath.ts index 1ea24fb..43674bd 100644 --- a/src/utils/ObjValueFromPath.ts +++ b/src/utils/ObjValueFromPath.ts @@ -4,7 +4,7 @@ export function getObjValueFromPath(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; }