Skip to content
Snippets Groups Projects
Unverified Commit 47931db1 authored by Takeshi Umeda's avatar Takeshi Umeda Committed by GitHub
Browse files

Add thumbnail_remote_url in MediaAttachment REST response (#14358)

* Add thumbnail_remote_url in MediaAttachment REST response

* Change thumbnail_remote_url to preview_remote_url
parent 2ada2ae1
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -35,6 +35,10 @@ class REST::MediaAttachmentSerializer < ActiveModel::Serializer
end
end
def preview_remote_url
object.thumbnail_remote_url.presence
end
def text_url
object.local? ? medium_url(object) : nil
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment