From dbfe3b0b9a659f60d38d79fe5434db3494ba207d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 1 Jun 2021 14:07:02 +0200 Subject: [PATCH] :hammer: Refactor reduce for simplicity --- packages/nodes-base/nodes/Zoho/GenericFunctions.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/nodes-base/nodes/Zoho/GenericFunctions.ts b/packages/nodes-base/nodes/Zoho/GenericFunctions.ts index e13b7367c1..29658e515d 100644 --- a/packages/nodes-base/nodes/Zoho/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zoho/GenericFunctions.ts @@ -230,15 +230,10 @@ const adjustCustomFields = (allFields: AllFields) => { if (!customFields?.customFields.length) return allFields; - const customFieldsObject = customFields.customFields.reduce((acc, cur) => { + return customFields.customFields.reduce((acc, cur) => { acc[cur.fieldId] = cur.value; return acc; - }, {} as { [key: string]: string }); - - return { - ...customFieldsObject, - ...rest, - }; + }, rest); }; // ----------------------------------------