Chore: Add additional_attributes to conversation seed

This commit is contained in:
Pranav Raj Sreepuram 2020-03-09 10:00:11 +05:30
parent 1273ea64d3
commit ef6c695bcb
2 changed files with 12 additions and 5 deletions

View file

@ -108,10 +108,9 @@ export default {
return channel;
},
conversationType() {
const {
additional_attributes: additionalAttributes = {},
} = this.currentChat;
return additionalAttributes.type || '';
const { additional_attributes: additionalAttributes } = this.currentChat;
const type = additionalAttributes ? additionalAttributes.type : '';
return type || '';
},
maxLength() {
if (this.channelType === 'Channel::FacebookPage') {

View file

@ -11,5 +11,13 @@ InboxMember.create!(user: user, inbox: inbox)
contact = Contact.create!(name: 'jane', email: 'jane@example.com', phone_number: '0000', account: account)
contact_inbox = ContactInbox.create!(inbox: inbox, contact: contact, source_id: user.id)
conversation = Conversation.create!(account: account, inbox: inbox, status: :open, assignee: user, contact: contact, contact_inbox: contact_inbox)
conversation = Conversation.create!(
account: account,
inbox: inbox,
status: :open,
assignee: user,
contact: contact,
contact_inbox: contact_inbox,
additional_attributes: {}
)
Message.create!(content: 'Hello', account: account, inbox: inbox, conversation: conversation, message_type: :incoming)