Skip to content

Commit e12d5da

Browse files
authored
Fix Sonar Audit
Fix Sonar Audit
2 parents d77f9e2 + 91d4279 commit e12d5da

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

processor/src/commercetools/action.commercetools.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export const setCustomFields = (fieldName: string, fieldValue: string) => {
3030
*/
3131
export const addInterfaceInteraction = (params: CreateInterfaceInteractionParams) => {
3232
const { sctm_action_type, sctm_request, sctm_response, sctm_id, sctm_created_at } = params;
33-
const interfaceInteractionId = sctm_id || uuid();
34-
const interfaceInteractionTimestamp = sctm_created_at || createDateNowString();
33+
const interfaceInteractionId = sctm_id ?? uuid();
34+
const interfaceInteractionTimestamp = sctm_created_at ?? createDateNowString();
3535

3636
return {
3737
action: 'addInterfaceInteraction',

processor/src/utils/app.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function parseStringToJsonObject(
3232
try {
3333
return JSON.parse(targetedString);
3434
} catch {
35-
const errorMessage = `${errorPrefix || 'SCTM - PAYMENT PROCESSING'} - Failed to parse the JSON string from the custom field ${fieldName}.`;
35+
const errorMessage = `${errorPrefix ?? 'SCTM - PAYMENT PROCESSING'} - Failed to parse the JSON string from the custom field ${fieldName}.`;
3636
logger.error(errorMessage, {
3737
commerceToolsId: commerceToolsId,
3838
});

0 commit comments

Comments
 (0)