Add contact_account and languages to instance API (#6574)
This commit is contained in:
		
							parent
							
								
									a6d10b05f6
								
							
						
					
					
						commit
						c421ad685d
					
				
					 1 changed files with 10 additions and 1 deletions
				
			
		| 
						 | 
					@ -4,7 +4,12 @@ class REST::InstanceSerializer < ActiveModel::Serializer
 | 
				
			||||||
  include RoutingHelper
 | 
					  include RoutingHelper
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  attributes :uri, :title, :description, :email,
 | 
					  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
 | 
					  def uri
 | 
				
			||||||
    Rails.configuration.x.local_domain
 | 
					    Rails.configuration.x.local_domain
 | 
				
			||||||
| 
						 | 
					@ -42,6 +47,10 @@ class REST::InstanceSerializer < ActiveModel::Serializer
 | 
				
			||||||
    { streaming_api: Rails.configuration.x.streaming_api_base_url }
 | 
					    { streaming_api: Rails.configuration.x.streaming_api_base_url }
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def languages
 | 
				
			||||||
 | 
					    [ENV.fetch('DEFAULT_LOCALE', I18n.default_locale)]
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  private
 | 
					  private
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def instance_presenter
 | 
					  def instance_presenter
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue