Chore: Scope URLs with account_id (#601)
* Chore: Enable Users to create multiple accounts Addresses: #402 - migrations to split roles and other attributes from users table - make changes in code to accommodate this change Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
10
app/views/api/v1/accounts/agents/index.json.jbuilder
Normal file
10
app/views/api/v1/accounts/agents/index.json.jbuilder
Normal file
@@ -0,0 +1,10 @@
|
||||
json.array! @agents do |agent|
|
||||
json.account_id agent.account.id
|
||||
json.availability_status agent.availability_status
|
||||
json.confirmed agent.confirmed?
|
||||
json.email agent.email
|
||||
json.id agent.id
|
||||
json.name agent.name
|
||||
json.role agent.role
|
||||
json.thumbnail agent.avatar_url
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
json.data do
|
||||
json.page_details @page_details
|
||||
json.user_access_token @user_access_token
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
json.payload do
|
||||
json.array! @conversations do |conversation|
|
||||
json.partial! 'api/v1/conversations/partials/conversation.json.jbuilder', conversation: conversation
|
||||
end
|
||||
end
|
||||
10
app/views/api/v1/accounts/contacts/index.json.jbuilder
Normal file
10
app/views/api/v1/accounts/contacts/index.json.jbuilder
Normal file
@@ -0,0 +1,10 @@
|
||||
json.payload do
|
||||
json.array! @contacts do |contact|
|
||||
json.id contact.id
|
||||
json.name contact.name
|
||||
json.email contact.email
|
||||
json.phone_number contact.phone_number
|
||||
json.thumbnail contact.avatar_url
|
||||
json.additional_attributes contact.additional_attributes
|
||||
end
|
||||
end
|
||||
9
app/views/api/v1/accounts/contacts/show.json.jbuilder
Normal file
9
app/views/api/v1/accounts/contacts/show.json.jbuilder
Normal file
@@ -0,0 +1,9 @@
|
||||
json.payload do
|
||||
json.availability_status @contact.availability_status
|
||||
json.email @contact.email
|
||||
json.id @contact.id
|
||||
json.name @contact.name
|
||||
json.phone_number @contact.phone_number
|
||||
json.thumbnail @contact.avatar_url
|
||||
json.additional_attributes @contact.additional_attributes
|
||||
end
|
||||
8
app/views/api/v1/accounts/contacts/update.json.jbuilder
Normal file
8
app/views/api/v1/accounts/contacts/update.json.jbuilder
Normal file
@@ -0,0 +1,8 @@
|
||||
json.payload do
|
||||
json.id @contact.id
|
||||
json.name @contact.name
|
||||
json.email @contact.email
|
||||
json.phone_number @contact.phone_number
|
||||
json.thumbnail @contact.avatar_url
|
||||
json.additional_attributes @contact.additional_attributes
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
json.payload do
|
||||
json.assignee @conversation.assignee
|
||||
json.conversation_id @conversation.display_id
|
||||
end
|
||||
12
app/views/api/v1/accounts/conversations/index.json.jbuilder
Normal file
12
app/views/api/v1/accounts/conversations/index.json.jbuilder
Normal file
@@ -0,0 +1,12 @@
|
||||
json.data do
|
||||
json.meta do
|
||||
json.mine_count @conversations_count[:mine_count]
|
||||
json.unassigned_count @conversations_count[:unassigned_count]
|
||||
json.all_count @conversations_count[:all_count]
|
||||
end
|
||||
json.payload do
|
||||
json.array! @conversations do |conversation|
|
||||
json.partial! 'api/v1/conversations/partials/conversation.json.jbuilder', conversation: conversation
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1 @@
|
||||
json.payload @labels
|
||||
@@ -0,0 +1 @@
|
||||
json.payload @labels
|
||||
@@ -0,0 +1,8 @@
|
||||
json.id @message.id
|
||||
json.content @message.content
|
||||
json.inbox_id @message.inbox_id
|
||||
json.conversation_id @message.conversation_id
|
||||
json.message_type @message.message_type_before_type_cast
|
||||
json.created_at @message.created_at.to_i
|
||||
json.private @message.private
|
||||
json.attachment @message.attachment.push_event_data if @message.attachment
|
||||
@@ -0,0 +1,20 @@
|
||||
json.meta do
|
||||
json.labels @conversation.label_list
|
||||
json.additional_attributes @conversation.additional_attributes
|
||||
json.contact_id @conversation.contact_id
|
||||
end
|
||||
|
||||
json.payload do
|
||||
json.array! @messages do |message|
|
||||
json.id message.id
|
||||
json.content message.content
|
||||
json.inbox_id message.inbox_id
|
||||
json.conversation_id message.conversation.display_id
|
||||
json.message_type message.message_type_before_type_cast
|
||||
json.created_at message.created_at.to_i
|
||||
json.private message.private
|
||||
json.source_id message.source_id
|
||||
json.attachment message.attachment.push_event_data if message.attachment
|
||||
json.sender message.user.push_event_data if message.user
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1 @@
|
||||
json.partial! 'api/v1/conversations/partials/conversation.json.jbuilder', conversation: @conversation
|
||||
@@ -0,0 +1,8 @@
|
||||
json.meta do
|
||||
end
|
||||
|
||||
json.payload do
|
||||
json.success @status
|
||||
json.current_status @conversation.status
|
||||
json.conversation_id @conversation.display_id
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
json.payload do
|
||||
json.array! @agents do |agent|
|
||||
json.user_id agent.id
|
||||
json.name agent.name
|
||||
end
|
||||
end
|
||||
13
app/views/api/v1/accounts/inboxes/index.json.jbuilder
Normal file
13
app/views/api/v1/accounts/inboxes/index.json.jbuilder
Normal file
@@ -0,0 +1,13 @@
|
||||
json.payload do
|
||||
json.array! @inboxes do |inbox|
|
||||
json.id inbox.id
|
||||
json.channel_id inbox.channel_id
|
||||
json.name inbox.name
|
||||
json.channel_type inbox.channel_type
|
||||
json.avatar_url inbox.channel.try(:avatar_url)
|
||||
json.page_id inbox.channel.try(:page_id)
|
||||
json.widget_color inbox.channel.try(:widget_color)
|
||||
json.website_token inbox.channel.try(:website_token)
|
||||
json.enable_auto_assignment inbox.enable_auto_assignment
|
||||
end
|
||||
end
|
||||
8
app/views/api/v1/accounts/labels/index.json.jbuilder
Normal file
8
app/views/api/v1/accounts/labels/index.json.jbuilder
Normal file
@@ -0,0 +1,8 @@
|
||||
json.data do
|
||||
json.meta do
|
||||
end
|
||||
|
||||
json.payload do
|
||||
json.labels @labels
|
||||
end
|
||||
end
|
||||
3
app/views/api/v1/accounts/labels/most_used.json.jbuilder
Normal file
3
app/views/api/v1/accounts/labels/most_used.json.jbuilder
Normal file
@@ -0,0 +1,3 @@
|
||||
json.payload do
|
||||
json.labels @labels
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
json.id @notification_setting.id
|
||||
json.user_id @notification_setting.user_id
|
||||
json.account_id @notification_setting.account_id
|
||||
json.all_email_flags @notification_setting.all_email_flags
|
||||
json.selected_email_flags @notification_setting.selected_email_flags
|
||||
@@ -0,0 +1,9 @@
|
||||
json.id webhook.id
|
||||
json.url webhook.url
|
||||
json.account_id webhook.account_id
|
||||
if webhook.inbox
|
||||
json.inbox do
|
||||
json.id webhook.inbox.id
|
||||
json.name webhook.inbox.name
|
||||
end
|
||||
end
|
||||
5
app/views/api/v1/accounts/webhooks/create.json.jbuilder
Normal file
5
app/views/api/v1/accounts/webhooks/create.json.jbuilder
Normal file
@@ -0,0 +1,5 @@
|
||||
json.payload do
|
||||
json.webhook do
|
||||
json.partial! 'webhook', webhook: @webhook
|
||||
end
|
||||
end
|
||||
5
app/views/api/v1/accounts/webhooks/index.json.jbuilder
Normal file
5
app/views/api/v1/accounts/webhooks/index.json.jbuilder
Normal file
@@ -0,0 +1,5 @@
|
||||
json.payload do
|
||||
json.webhooks do
|
||||
json.array! @webhooks, partial: 'webhook', as: :webhook
|
||||
end
|
||||
end
|
||||
5
app/views/api/v1/accounts/webhooks/update.json.jbuilder
Normal file
5
app/views/api/v1/accounts/webhooks/update.json.jbuilder
Normal file
@@ -0,0 +1,5 @@
|
||||
json.payload do
|
||||
json.webhook do
|
||||
json.partial! 'webhook', webhook: @webhook
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user