bug: fixes error in creating a new one off campaign (#3067)
* bug: fixes error in creating a new one off campaign * Review fixes Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
parent
1cb2226dbc
commit
8b7f6c691a
5 changed files with 13 additions and 3 deletions
|
@ -237,7 +237,7 @@ export default {
|
||||||
if (this.isOngoingType) {
|
if (this.isOngoingType) {
|
||||||
return this.$store.getters['inboxes/getWebsiteInboxes'];
|
return this.$store.getters['inboxes/getWebsiteInboxes'];
|
||||||
}
|
}
|
||||||
return this.$store.getters['inboxes/getTwilioInboxes'];
|
return this.$store.getters['inboxes/getTwilioSMSInboxes'];
|
||||||
},
|
},
|
||||||
sendersAndBotList() {
|
sendersAndBotList() {
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -161,7 +161,7 @@ export default {
|
||||||
if (this.isOngoingType) {
|
if (this.isOngoingType) {
|
||||||
return this.$store.getters['inboxes/getWebsiteInboxes'];
|
return this.$store.getters['inboxes/getWebsiteInboxes'];
|
||||||
}
|
}
|
||||||
return this.$store.getters['inboxes/getTwilioInboxes'];
|
return this.$store.getters['inboxes/getTwilioSMSInboxes'];
|
||||||
},
|
},
|
||||||
pageTitle() {
|
pageTitle() {
|
||||||
return `${this.$t('CAMPAIGN.EDIT.TITLE')} - ${
|
return `${this.$t('CAMPAIGN.EDIT.TITLE')} - ${
|
||||||
|
|
|
@ -73,6 +73,11 @@ export const getters = {
|
||||||
item => item.channel_type === INBOX_TYPES.TWILIO
|
item => item.channel_type === INBOX_TYPES.TWILIO
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
getTwilioSMSInboxes($state) {
|
||||||
|
return $state.records.filter(
|
||||||
|
item => item.channel_type === INBOX_TYPES.TWILIO && item.medium === 'sms'
|
||||||
|
);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const actions = {
|
export const actions = {
|
||||||
|
|
|
@ -49,10 +49,10 @@ export default [
|
||||||
name: 'Test Widget 5',
|
name: 'Test Widget 5',
|
||||||
channel_type: 'Channel::TwilioSms',
|
channel_type: 'Channel::TwilioSms',
|
||||||
avatar_url: null,
|
avatar_url: null,
|
||||||
|
medium: 'sms',
|
||||||
page_id: null,
|
page_id: null,
|
||||||
widget_color: '#68BC00',
|
widget_color: '#68BC00',
|
||||||
website_token: 'randomid125',
|
website_token: 'randomid125',
|
||||||
enable_auto_assignment: true,
|
enable_auto_assignment: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -19,6 +19,11 @@ describe('#getters', () => {
|
||||||
expect(getters.getTwilioInboxes(state).length).toEqual(1);
|
expect(getters.getTwilioInboxes(state).length).toEqual(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('getTwilioSMSInboxes', () => {
|
||||||
|
const state = { records: inboxList };
|
||||||
|
expect(getters.getTwilioSMSInboxes(state).length).toEqual(1);
|
||||||
|
});
|
||||||
|
|
||||||
it('getInbox', () => {
|
it('getInbox', () => {
|
||||||
const state = {
|
const state = {
|
||||||
records: inboxList,
|
records: inboxList,
|
||||||
|
|
Loading…
Reference in a new issue