mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-03 12:37:56 +00:00
chore: Sync pre-chat fields after custom attribute update (#4692)
This commit is contained in:
@@ -34,6 +34,7 @@ class CustomAttributeDefinition < ApplicationRecord
|
||||
enum attribute_display_type: { text: 0, number: 1, currency: 2, percent: 3, link: 4, date: 5, list: 6, checkbox: 7 }
|
||||
|
||||
belongs_to :account
|
||||
after_update :update_widget_pre_chat_custom_fields
|
||||
after_destroy :sync_widget_pre_chat_custom_fields
|
||||
|
||||
private
|
||||
@@ -41,4 +42,8 @@ class CustomAttributeDefinition < ApplicationRecord
|
||||
def sync_widget_pre_chat_custom_fields
|
||||
::Inboxes::SyncWidgetPreChatCustomFieldsJob.perform_now(account, attribute_key)
|
||||
end
|
||||
|
||||
def update_widget_pre_chat_custom_fields
|
||||
::Inboxes::UpdateWidgetPreChatCustomFieldsJob.perform_now(account, self)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user