iachat/app/views/api/v1/widget/messages/create.json.jbuilder
Muhsin Keloth 05b8486538
fix: message_type inconsistency across message end points (#10108)
The `before_type_cast` method sometimes returns a string for
`message_type`, creating inconsistencies in different payloads. This
pull request will remove all `before_type_cast` usage and replace it
with `to_i` methods.
2024-09-16 16:14:35 +05:30

12 lines
495 B
Ruby

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.created_at @message.created_at.to_i
json.private @message.private
json.source_id @message.source_id
json.content_attributes @message.content_attributes
json.attachments @message.attachments.map(&:push_event_data) if @message.attachments.present?
json.sender @message.sender.push_event_data if @message.sender