From 64c4aab45a9b4d12809b4edf136e71bf401dc4d5 Mon Sep 17 00:00:00 2001 From: shrouti1507 Date: Fri, 26 Apr 2024 13:16:16 +0530 Subject: [PATCH] feat: review comments addressed --- src/cdk/v2/destinations/algolia/procWorkflow.yaml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/cdk/v2/destinations/algolia/procWorkflow.yaml b/src/cdk/v2/destinations/algolia/procWorkflow.yaml index 328aad4314..87da64aa45 100644 --- a/src/cdk/v2/destinations/algolia/procWorkflow.yaml +++ b/src/cdk/v2/destinations/algolia/procWorkflow.yaml @@ -50,18 +50,13 @@ steps: description: | Populate list of objectData template: | - const populateObjectData = function(singleProduct) { - singleProduct.({ + const products = ^.message.properties.products + products.($.removeUndefinedAndNullValues({ "queryID" : $.isDefinedAndNotNull(.queryID) ? String(.queryID) : null, "price": $.isDefinedAndNotNull(.price) && $.isDefinedAndNotNull(^.message.properties.currency) ? String(.price) : null, "quantity": $.isDefinedAndNotNull(.quantity)? Number(.quantity) : null, "discount": $.isDefinedAndNotNull(.discount) ? String(.discount) : null - }) - }; - const products = ^.message.properties.products - products.map(function(singleProduct) { - $.removeUndefinedAndNullValues(populateObjectData(singleProduct)) - })[] + }))[] - name: populateProductsData condition: |