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:
Sivin Varghese 2021-09-24 20:37:30 +05:30 committed by GitHub
parent 1cb2226dbc
commit 8b7f6c691a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 3 deletions

View file

@ -237,7 +237,7 @@ export default {
if (this.isOngoingType) {
return this.$store.getters['inboxes/getWebsiteInboxes'];
}
return this.$store.getters['inboxes/getTwilioInboxes'];
return this.$store.getters['inboxes/getTwilioSMSInboxes'];
},
sendersAndBotList() {
return [

View file

@ -161,7 +161,7 @@ export default {
if (this.isOngoingType) {
return this.$store.getters['inboxes/getWebsiteInboxes'];
}
return this.$store.getters['inboxes/getTwilioInboxes'];
return this.$store.getters['inboxes/getTwilioSMSInboxes'];
},
pageTitle() {
return `${this.$t('CAMPAIGN.EDIT.TITLE')} - ${

View file

@ -73,6 +73,11 @@ export const getters = {
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 = {

View file

@ -49,10 +49,10 @@ export default [
name: 'Test Widget 5',
channel_type: 'Channel::TwilioSms',
avatar_url: null,
medium: 'sms',
page_id: null,
widget_color: '#68BC00',
website_token: 'randomid125',
enable_auto_assignment: true,
},
];

View file

@ -19,6 +19,11 @@ describe('#getters', () => {
expect(getters.getTwilioInboxes(state).length).toEqual(1);
});
it('getTwilioSMSInboxes', () => {
const state = { records: inboxList };
expect(getters.getTwilioSMSInboxes(state).length).toEqual(1);
});
it('getInbox', () => {
const state = {
records: inboxList,