mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-03 12:37:56 +00:00
fix: First attachment with caption for whatsapp channel (#6486)
This commit is contained in:
committed by
GitHub
parent
cd6a836bf6
commit
8935933266
@@ -968,15 +968,9 @@ export default {
|
||||
},
|
||||
getMessagePayloadForWhatsapp(message) {
|
||||
const multipleMessagePayload = [];
|
||||
const messagePayload = {
|
||||
conversationId: this.currentChat.id,
|
||||
message,
|
||||
private: false,
|
||||
};
|
||||
|
||||
multipleMessagePayload.push(messagePayload);
|
||||
|
||||
if (this.attachedFiles && this.attachedFiles.length) {
|
||||
let caption = message;
|
||||
this.attachedFiles.forEach(attachment => {
|
||||
const attachedFile = this.globalConfig.directUploadsEnabled
|
||||
? attachment.blobSignedId
|
||||
@@ -985,10 +979,18 @@ export default {
|
||||
conversationId: this.currentChat.id,
|
||||
files: [attachedFile],
|
||||
private: false,
|
||||
message: '',
|
||||
message: caption,
|
||||
};
|
||||
multipleMessagePayload.push(attachmentPayload);
|
||||
caption = '';
|
||||
});
|
||||
} else {
|
||||
const messagePayload = {
|
||||
conversationId: this.currentChat.id,
|
||||
message,
|
||||
private: false,
|
||||
};
|
||||
multipleMessagePayload.push(messagePayload);
|
||||
}
|
||||
|
||||
return multipleMessagePayload;
|
||||
|
||||
Reference in New Issue
Block a user