feat: include attachment ID in the JSON response for attachments (#201)

* feat: include attachment ID in the JSON response for attachments

* test: verify attachment ID in conversation response payload
This commit is contained in:
Gabriel Jablonski 2026-01-29 16:12:45 -03:00 committed by GitHub
parent 4ca0ef22c0
commit 5c99805fe2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -3,6 +3,7 @@ json.meta do
end
json.payload @attachments do |attachment|
json.id attachment.push_event_data[:id]
json.message_id attachment.push_event_data[:message_id]
json.thumb_url attachment.push_event_data[:thumb_url]
json.data_url attachment.push_event_data[:data_url]

View File

@ -953,6 +953,7 @@ RSpec.describe 'Conversations API', type: :request do
expect(response).to have_http_status(:success)
response_body = response.parsed_body
expect(response_body['payload'].first['id']).to eq(conversation.messages.last.attachments.first.id)
expect(response_body['payload'].first['file_type']).to eq('image')
expect(response_body['payload'].first['sender']['id']).to eq(conversation.messages.last.sender.id)
end