Skip to content

Commit

Permalink
Add thumbnail_remote_url in MediaAttachment REST response (#14358)
Browse files Browse the repository at this point in the history
* Add thumbnail_remote_url in MediaAttachment REST response

* Change thumbnail_remote_url to preview_remote_url
  • Loading branch information
noellabo authored Jul 19, 2020
1 parent 2ada2ae commit 47931db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/serializers/rest/media_attachment_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class REST::MediaAttachmentSerializer < ActiveModel::Serializer
include RoutingHelper

attributes :id, :type, :url, :preview_url,
:remote_url, :text_url, :meta,
:remote_url, :preview_remote_url, :text_url, :meta,
:description, :blurhash

def id
Expand Down Expand Up @@ -35,6 +35,10 @@ def preview_url
end
end

def preview_remote_url
object.thumbnail_remote_url.presence
end

def text_url
object.local? ? medium_url(object) : nil
end
Expand Down

0 comments on commit 47931db

Please sign in to comment.