feat: Add AgentBot APIs (#2323)

This commit is contained in:
Sojan Jose
2021-06-01 22:34:25 +05:30
committed by GitHub
parent 9d16e52e33
commit 22965be6dc
31 changed files with 552 additions and 67 deletions

View File

@@ -0,0 +1 @@
json.partial! 'api/v1/models/agent_bot.json.jbuilder', resource: @agent_bot

View File

@@ -0,0 +1,3 @@
json.array! @agent_bots do |agent_bot|
json.partial! 'api/v1/models/agent_bot.json.jbuilder', resource: agent_bot
end

View File

@@ -0,0 +1 @@
json.partial! 'api/v1/models/agent_bot.json.jbuilder', resource: @agent_bot

View File

@@ -0,0 +1 @@
json.partial! 'api/v1/models/agent_bot.json.jbuilder', resource: @agent_bot

View File

@@ -0,0 +1,3 @@
json.agent_bot do
json.partial! 'api/v1/models/agent_bot.json.jbuilder', resource: @agent_bot if @agent_bot.present?
end

View File

@@ -0,0 +1,5 @@
json.id resource.id
json.name resource.name
json.description resource.description
json.outgoing_url resource.name
json.account_id resource.account_id

View File

@@ -0,0 +1 @@
json.partial! 'platform/api/v1/models/agent_bot.json.jbuilder', resource: @resource

View File

@@ -0,0 +1,3 @@
json.array! @resources do |resource|
json.partial! 'platform/api/v1/models/agent_bot.json.jbuilder', resource: resource.permissible
end

View File

@@ -0,0 +1 @@
json.partial! 'platform/api/v1/models/agent_bot.json.jbuilder', resource: @resource

View File

@@ -0,0 +1 @@
json.partial! 'platform/api/v1/models/agent_bot.json.jbuilder', resource: @resource

View File

@@ -0,0 +1,5 @@
json.id resource.id
json.name resource.name
json.description resource.description
json.outgoing_url resource.name
json.account_id resource.account_id

View File

@@ -8,9 +8,6 @@
window.chatwootWebChannel = {
avatarUrl: '<%= @web_widget.inbox.avatar_url %>',
hasAConnectedAgentBot: '<%= @web_widget.inbox.agent_bot&.name %>',
<% if @web_widget.inbox.agent_bot %>
hideInputForBotConversations: <%= @web_widget.inbox.agent_bot.hide_input_for_bot_conversations %>,
<% end %>
locale: '<%= @web_widget.account.locale %>',
websiteName: '<%= @web_widget.inbox.name %>',
websiteToken: '<%= @web_widget.website_token %>',