diff --git a/src/channel/whatsappUtils.js b/src/channel/whatsappUtils.js index dbc415f..901f7ce 100644 --- a/src/channel/whatsappUtils.js +++ b/src/channel/whatsappUtils.js @@ -233,11 +233,11 @@ const whatsappMsgMapped = { return isEmpty(result?.whatsappMessage) ? null : { ...result.whatsappMessage, conversationid: result.conversationid, messageorigin: result.messageorigin }; }, contentToRender: (contentObj) => { - if ((contentObj?.status === 'failed' ) && contentObj.errorCode !== 'BAD_REQUEST') { + if (contentObj?.status === 'failed' && ['130472', 'BAD_REQUEST'].includes(contentObj.errorCode)) { contentObj = { ...contentObj, type: 'error', - text: {body: `❌ ${whatsappError?.[contentObj.errorCode] || contentObj.errorMessage}` }, // contentObj.errorMessage // Message failed to send. + text: { body: `❌ ${whatsappError?.[contentObj.errorCode] || contentObj.errorMessage}` }, // contentObj.errorMessage // Message failed to send. id: contentObj.id, wamid: contentObj.id, };