diff --git a/processor/src/commercetools/action.commercetools.ts b/processor/src/commercetools/action.commercetools.ts index 9cba639..1904b3a 100644 --- a/processor/src/commercetools/action.commercetools.ts +++ b/processor/src/commercetools/action.commercetools.ts @@ -30,8 +30,8 @@ export const setCustomFields = (fieldName: string, fieldValue: string) => { */ export const addInterfaceInteraction = (params: CreateInterfaceInteractionParams) => { const { sctm_action_type, sctm_request, sctm_response, sctm_id, sctm_created_at } = params; - const interfaceInteractionId = sctm_id || uuid(); - const interfaceInteractionTimestamp = sctm_created_at || createDateNowString(); + const interfaceInteractionId = sctm_id ?? uuid(); + const interfaceInteractionTimestamp = sctm_created_at ?? createDateNowString(); return { action: 'addInterfaceInteraction', diff --git a/processor/src/utils/app.utils.ts b/processor/src/utils/app.utils.ts index c1dd0be..23cdc3e 100644 --- a/processor/src/utils/app.utils.ts +++ b/processor/src/utils/app.utils.ts @@ -32,7 +32,7 @@ export function parseStringToJsonObject( try { return JSON.parse(targetedString); } catch { - const errorMessage = `${errorPrefix || 'SCTM - PAYMENT PROCESSING'} - Failed to parse the JSON string from the custom field ${fieldName}.`; + const errorMessage = `${errorPrefix ?? 'SCTM - PAYMENT PROCESSING'} - Failed to parse the JSON string from the custom field ${fieldName}.`; logger.error(errorMessage, { commerceToolsId: commerceToolsId, });