feat: Add AgentBot APIs (#2323)
This commit is contained in:
@@ -0,0 +1 @@
|
||||
json.partial! 'api/v1/models/agent_bot.json.jbuilder', resource: @agent_bot
|
||||
3
app/views/api/v1/accounts/agent_bots/index.json.jbuilder
Normal file
3
app/views/api/v1/accounts/agent_bots/index.json.jbuilder
Normal 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
|
||||
1
app/views/api/v1/accounts/agent_bots/show.json.jbuilder
Normal file
1
app/views/api/v1/accounts/agent_bots/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! 'api/v1/models/agent_bot.json.jbuilder', resource: @agent_bot
|
||||
@@ -0,0 +1 @@
|
||||
json.partial! 'api/v1/models/agent_bot.json.jbuilder', resource: @agent_bot
|
||||
@@ -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
|
||||
5
app/views/api/v1/models/_agent_bot.json.jbuilder
Normal file
5
app/views/api/v1/models/_agent_bot.json.jbuilder
Normal 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
|
||||
@@ -0,0 +1 @@
|
||||
json.partial! 'platform/api/v1/models/agent_bot.json.jbuilder', resource: @resource
|
||||
3
app/views/platform/api/v1/agent_bots/index.json.jbuilder
Normal file
3
app/views/platform/api/v1/agent_bots/index.json.jbuilder
Normal file
@@ -0,0 +1,3 @@
|
||||
json.array! @resources do |resource|
|
||||
json.partial! 'platform/api/v1/models/agent_bot.json.jbuilder', resource: resource.permissible
|
||||
end
|
||||
1
app/views/platform/api/v1/agent_bots/show.json.jbuilder
Normal file
1
app/views/platform/api/v1/agent_bots/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! 'platform/api/v1/models/agent_bot.json.jbuilder', resource: @resource
|
||||
@@ -0,0 +1 @@
|
||||
json.partial! 'platform/api/v1/models/agent_bot.json.jbuilder', resource: @resource
|
||||
@@ -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
|
||||
@@ -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 %>',
|
||||
|
||||
Reference in New Issue
Block a user