chore: Add support for message_templates in API inbox (#4835)
This commit is contained in:
@@ -51,9 +51,20 @@ export const getters = {
|
||||
const [inbox] = $state.records.filter(
|
||||
record => record.id === Number(inboxId)
|
||||
);
|
||||
|
||||
const {
|
||||
message_templates: whatsAppMessageTemplates,
|
||||
additional_attributes: additionalAttributes,
|
||||
} = inbox;
|
||||
|
||||
const { message_templates: apiInboxMessageTemplates } =
|
||||
additionalAttributes || {};
|
||||
const messagesTemplates =
|
||||
whatsAppMessageTemplates || apiInboxMessageTemplates;
|
||||
|
||||
// filtering out the whatsapp templates with media
|
||||
if (inbox.message_templates) {
|
||||
return inbox.message_templates.filter(template => {
|
||||
if (messagesTemplates) {
|
||||
return messagesTemplates.filter(template => {
|
||||
return !template.components.some(
|
||||
i => i.format === 'IMAGE' || i.format === 'VIDEO'
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user