Skip to content
Snippets Groups Projects
Commit 967e7066 authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

In REST API, when URL can be missing, cast it to nil (#5259)

parent b7e65a00
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
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