feat: Add webhook events for contact created, updated (#6415)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Shubham Kumar
2023-02-14 02:58:27 +05:30
committed by GitHub
parent ba69f4cd35
commit 29025759d6
13 changed files with 113 additions and 16 deletions

View File

@@ -0,0 +1,9 @@
class UpdateDefaultOnSubscriptionsWebhooks < ActiveRecord::Migration[6.1]
def change
change_column_default :webhooks, :subscriptions,
from: %w[conversation_status_changed conversation_updated conversation_created
message_created message_updated webwidget_triggered],
to: %w[conversation_status_changed conversation_updated conversation_created
contact_created contact_updated message_created message_updated webwidget_triggered]
end
end

View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2022_12_30_113108) do
ActiveRecord::Schema.define(version: 2023_02_09_033203) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"
@@ -851,7 +851,7 @@ ActiveRecord::Schema.define(version: 2022_12_30_113108) do
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.integer "webhook_type", default: 0
t.jsonb "subscriptions", default: ["conversation_status_changed", "conversation_updated", "conversation_created", "message_created", "message_updated", "webwidget_triggered"]
t.jsonb "subscriptions", default: ["conversation_status_changed", "conversation_updated", "conversation_created", "contact_created", "contact_updated", "message_created", "message_updated", "webwidget_triggered"]
t.index ["account_id", "url"], name: "index_webhooks_on_account_id_and_url", unique: true
end