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) {
|
||||
return this.$store.getters['inboxes/getWebsiteInboxes'];
|
||||
}
|
||||
return this.$store.getters['inboxes/getTwilioInboxes'];
|
||||
return this.$store.getters['inboxes/getTwilioSMSInboxes'];
|
||||
},
|
||||
sendersAndBotList() {
|
||||
return [
|
||||
|
|
|
@ -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')} - ${
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
|
||||
];
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue