From fc3def40eddc86df82bde99076d6409138ddf017 Mon Sep 17 00:00:00 2001 From: shrouti1507 <60211312+shrouti1507@users.noreply.github.com> Date: Thu, 25 Apr 2024 20:19:52 +0530 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Gauravudia <60897972+Gauravudia@users.noreply.github.com> --- src/cdk/v2/destinations/algolia/procWorkflow.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/cdk/v2/destinations/algolia/procWorkflow.yaml b/src/cdk/v2/destinations/algolia/procWorkflow.yaml index f13777a40e..70161cc2ca 100644 --- a/src/cdk/v2/destinations/algolia/procWorkflow.yaml +++ b/src/cdk/v2/destinations/algolia/procWorkflow.yaml @@ -26,11 +26,8 @@ steps: $.assert(.message.properties.index, 'Missing required value from "properties.index"'); let eventTypeMap = $.eventTypeMapping(.destination.Config); let event = .message.event.trim().toLowerCase(); - let eventType = .message.properties.eventType ?? eventTypeMap[event]; - let eventSubType = .message.properties.eventSubtype && eventType === 'conversion' ? - .message.properties.eventSubtype in $.ALLOWED_EVENT_SUBTYPES ? - .message.properties.eventSubtype : null - : null; + let eventType = .message.properties?.eventType ?? eventTypeMap[event]; + let eventSubType = .message.properties?.eventSubtype in $.ALLOWED_EVENT_SUBTYPES && eventType === 'conversion' ? .message.properties.eventSubtype: null; $.assert(eventType, "eventType is mandatory for track call"); let payload = .message.().({ index: .properties.index,