|
|
|
@ -233,7 +233,7 @@ const whatsappMsgMapped = {
|
|
|
|
|
return isEmpty(result?.whatsappMessage) ? null : { ...result.whatsappMessage, conversationid: result.conversationid, messageorigin: result.messageorigin };
|
|
|
|
|
},
|
|
|
|
|
contentToRender: (contentObj) => {
|
|
|
|
|
if ((contentObj?.status === 'failed' )) {
|
|
|
|
|
if ((contentObj?.status === 'failed' ) && contentObj.errorCode !== 'BAD_REQUEST') {
|
|
|
|
|
contentObj = {
|
|
|
|
|
...contentObj,
|
|
|
|
|
type: 'error',
|
|
|
|
@ -291,7 +291,8 @@ export const receivedMsgTypeMapped = {
|
|
|
|
|
getMsg: (result) => result,
|
|
|
|
|
contentToRender: () => null,
|
|
|
|
|
contentToUpdate: (msgcontent) => {
|
|
|
|
|
let apiErrorCode, apiErrorMsg = '';
|
|
|
|
|
let apiErrorCode,
|
|
|
|
|
apiErrorMsg = '';
|
|
|
|
|
const waCode = msgcontent.error.message.match(/\(#(\d+)\)/);
|
|
|
|
|
let waError = whatsappError?.[waCode?.[1]] || msgcontent.error.message;
|
|
|
|
|
|
|
|
|
@ -302,12 +303,13 @@ export const receivedMsgTypeMapped = {
|
|
|
|
|
apiErrorMsg = '';
|
|
|
|
|
}
|
|
|
|
|
return {
|
|
|
|
|
...msgcontent,
|
|
|
|
|
id: msgcontent.actionId,
|
|
|
|
|
status: msgcontent?.status || 'failed',
|
|
|
|
|
dateString: `发送失败 ${waError} \n[${msgcontent.error.code}] ${apiErrorMsg} ❌`,
|
|
|
|
|
conversationid: msgcontent.actionId.split('.')[0],
|
|
|
|
|
};},
|
|
|
|
|
...msgcontent,
|
|
|
|
|
id: msgcontent.actionId,
|
|
|
|
|
status: msgcontent?.status || 'failed',
|
|
|
|
|
dateString: `发送失败 ${waError} \n[${msgcontent.error.code}] ${apiErrorMsg} ❌`,
|
|
|
|
|
conversationid: msgcontent.actionId.split('.')[0],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
export const whatsappMsgTypeMapped = {
|
|
|
|
|