Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add sender details and message create date in the attachment API (
- Loading branch information
Showing
2 changed files
with
11 additions
and
1 deletion.
There are no files selected for viewing
11 changes: 10 additions & 1 deletion
11
app/views/api/v1/accounts/conversations/attachments.json.jbuilder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
json.payload @attachments.map(&:push_event_data) | ||
json.payload @attachments do |attachment| | ||
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] | ||
json.file_size attachment.push_event_data[:file_size] | ||
json.file_type attachment.push_event_data[:file_type] | ||
json.extension attachment.push_event_data[:extension] | ||
json.created_at attachment.message.created_at.to_i | ||
json.sender attachment.message.sender.push_event_data if attachment.message.sender | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters