Feature: Support account/inbox specific webhooks (#562)
This commit is contained in:
@@ -33,7 +33,7 @@ class Inbox < ApplicationRecord
|
||||
has_many :members, through: :inbox_members, source: :user
|
||||
has_many :conversations, dependent: :destroy
|
||||
has_many :messages, through: :conversations
|
||||
has_one :webhook, dependent: :destroy
|
||||
has_many :webhooks, dependent: :destroy
|
||||
after_create :subscribe_webhook, if: :facebook?
|
||||
after_destroy :delete_round_robin_agents
|
||||
|
||||
@@ -60,6 +60,13 @@ class Inbox < ApplicationRecord
|
||||
account.users.find_by(id: user_id)
|
||||
end
|
||||
|
||||
def webhook_data
|
||||
{
|
||||
id: id,
|
||||
name: name
|
||||
}
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def delete_round_robin_agents
|
||||
|
||||
Reference in New Issue
Block a user