mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-22 17:17:32 +00:00
In REST API, when URL can be missing, cast it to nil (#5259)
This commit is contained in:
parent
b7e65a004f
commit
967e70663f
|
@ -15,4 +15,8 @@ class REST::ApplicationSerializer < ActiveModel::Serializer
|
|||
def client_secret
|
||||
object.secret
|
||||
end
|
||||
|
||||
def website
|
||||
object.website.presence
|
||||
end
|
||||
end
|
||||
|
|
|
@ -19,6 +19,10 @@ class REST::MediaAttachmentSerializer < ActiveModel::Serializer
|
|||
end
|
||||
end
|
||||
|
||||
def remote_url
|
||||
object.remote_url.presence
|
||||
end
|
||||
|
||||
def preview_url
|
||||
if object.needs_redownload?
|
||||
media_proxy_url(object.id, :small)
|
||||
|
|
Loading…
Reference in a new issue