Skip to content

Commit

Permalink
feat: review comments addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
shrouti1507 committed Apr 26, 2024
1 parent 844d548 commit 64c4aab
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/cdk/v2/destinations/algolia/procWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down

0 comments on commit 64c4aab

Please sign in to comment.