From ef6c695bcb9b34804b5e92c50769d2365b9e544d Mon Sep 17 00:00:00 2001 From: Pranav Raj Sreepuram Date: Mon, 9 Mar 2020 10:00:11 +0530 Subject: [PATCH] Chore: Add additional_attributes to conversation seed --- .../components/widgets/conversation/ReplyBox.vue | 7 +++---- db/seeds.rb | 10 +++++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue index fff476945..ba554191f 100644 --- a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue +++ b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue @@ -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') { diff --git a/db/seeds.rb b/db/seeds.rb index aed828286..b6cfa2d3d 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -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)