revert: "fix: message_type inconsistency across message end points" (#10119)
Reverts chatwoot/chatwoot#10108
This commit is contained in:
@@ -137,7 +137,7 @@ class Message < ApplicationRecord
|
||||
def push_event_data
|
||||
data = attributes.symbolize_keys.merge(
|
||||
created_at: created_at.to_i,
|
||||
message_type: message_type.to_i,
|
||||
message_type: message_type_before_type_cast,
|
||||
conversation_id: conversation.display_id,
|
||||
conversation: conversation_push_event_data
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
json.id message.id
|
||||
json.content message.content
|
||||
json.message_type message.message_type.to_i
|
||||
json.message_type message.message_type_before_type_cast
|
||||
json.content_type message.content_type
|
||||
json.source_id message.source_id
|
||||
json.inbox_id message.inbox_id
|
||||
|
||||
@@ -17,7 +17,7 @@ json.messages do
|
||||
json.content message.content
|
||||
json.id message.id
|
||||
json.sender_name message.sender.name if message.sender
|
||||
json.message_type message.message_type.to_i
|
||||
json.message_type message.message_type_before_type_cast
|
||||
json.created_at message.created_at.to_i
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@ json.content message.content
|
||||
json.inbox_id message.inbox_id
|
||||
json.echo_id message.echo_id if message.echo_id
|
||||
json.conversation_id message.conversation.display_id
|
||||
json.message_type message.message_type.to_i
|
||||
json.message_type message.message_type_before_type_cast
|
||||
json.content_type message.content_type
|
||||
json.status message.status
|
||||
json.content_attributes message.content_attributes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
json.id resource.id
|
||||
json.content resource.content
|
||||
json.message_type resource.message_type.to_i
|
||||
json.message_type resource.message_type_before_type_cast
|
||||
json.content_type resource.content_type
|
||||
json.content_attributes resource.content_attributes
|
||||
json.created_at resource.created_at.to_i
|
||||
|
||||
@@ -2,7 +2,7 @@ json.id @message.id
|
||||
json.content @message.content
|
||||
json.inbox_id @message.inbox_id
|
||||
json.conversation_id @message.conversation.display_id
|
||||
json.message_type @message.message_type.to_i
|
||||
json.message_type @message.message_type_before_type_cast
|
||||
json.created_at @message.created_at.to_i
|
||||
json.private @message.private
|
||||
json.source_id @message.source_id
|
||||
|
||||
@@ -2,7 +2,7 @@ json.payload do
|
||||
json.array! @messages do |message|
|
||||
json.id message.id
|
||||
json.content message.content
|
||||
json.message_type message.message_type.to_i
|
||||
json.message_type message.message_type_before_type_cast
|
||||
json.content_type message.content_type
|
||||
json.content_attributes message.content_attributes
|
||||
json.created_at message.created_at.to_i
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
json.id resource.id
|
||||
json.content resource.content
|
||||
json.message_type resource.message_type.to_i
|
||||
json.message_type resource.message_type_before_type_cast
|
||||
json.content_type resource.content_type
|
||||
json.content_attributes resource.content_attributes
|
||||
json.created_at resource.created_at.to_i
|
||||
|
||||
Reference in New Issue
Block a user