Skip to content

Commit

Permalink
Fix Sonar Audit
Browse files Browse the repository at this point in the history
Fix Sonar Audit
  • Loading branch information
NghiaDTr authored Oct 3, 2024
2 parents d77f9e2 + 91d4279 commit e12d5da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions processor/src/commercetools/action.commercetools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion processor/src/utils/app.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down

0 comments on commit e12d5da

Please sign in to comment.