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

Add contact_account and languages to instance API (#6574)

parent 51b7a22e
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,12 @@ class REST::InstanceSerializer < ActiveModel::Serializer
include RoutingHelper
attributes :uri, :title, :description, :email,
:version, :urls, :stats, :thumbnail
:version, :urls, :stats, :thumbnail,
:languages
has_one :contact_account, serializer: REST::AccountSerializer
delegate :contact_account, to: :instance_presenter
def uri
Rails.configuration.x.local_domain
......@@ -42,6 +47,10 @@ class REST::InstanceSerializer < ActiveModel::Serializer
{ streaming_api: Rails.configuration.x.streaming_api_base_url }
end
def languages
[ENV.fetch('DEFAULT_LOCALE', I18n.default_locale)]
end
private
def instance_presenter
......
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