From c4edd048f5ce392ce7341f416a3e7554d3b5de20 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Fri, 19 Apr 2024 16:48:05 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=8F=91=E9=80=81=E5=A4=B1=E8=B4=A5:?= =?UTF-8?q?=20=E7=81=B0=E5=BA=A6=E7=94=A8=E6=88=B7=20=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=B3=BB=E7=BB=9F=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/channel/whatsappUtils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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, };