feat: Add support for Whatsapp template messages in the UI (#4711)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Fayaz Ahmed
2022-06-07 17:33:33 +05:30
committed by GitHub
parent 56f668db6b
commit bad24f97ab
22 changed files with 733 additions and 54 deletions

View File

@@ -47,6 +47,20 @@ export const getters = {
getInboxes($state) {
return $state.records;
},
getWhatsAppTemplates: $state => inboxId => {
const [inbox] = $state.records.filter(
record => record.id === Number(inboxId)
);
// filtering out the whatsapp templates with media
if (inbox.message_templates) {
return inbox.message_templates.filter(template => {
return !template.components.some(
i => i.format === 'IMAGE' || i.format === 'VIDEO'
);
});
}
return [];
},
getNewConversationInboxes($state) {
return $state.records.filter(inbox => {
const {