Add “services” and “metadata” to NodeInfo (#18563)
* add services to NodeInfo response * add metadata to NodeInfo response * learning ruby syntax! * patch the patch * rm trailing whitespace * use [] instead of empty array constructor
This commit is contained in:
		
							parent
							
								
									2e772770d7
								
							
						
					
					
						commit
						a0e108fd53
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
					@ -3,7 +3,7 @@
 | 
				
			||||||
class NodeInfo::Serializer < ActiveModel::Serializer
 | 
					class NodeInfo::Serializer < ActiveModel::Serializer
 | 
				
			||||||
  include RoutingHelper
 | 
					  include RoutingHelper
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  attributes :version, :software, :protocols, :usage, :open_registrations
 | 
					  attributes :version, :software, :protocols, :services, :usage, :open_registrations, :metadata
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def version
 | 
					  def version
 | 
				
			||||||
    '2.0'
 | 
					    '2.0'
 | 
				
			||||||
| 
						 | 
					@ -37,6 +37,10 @@ class NodeInfo::Serializer < ActiveModel::Serializer
 | 
				
			||||||
    Setting.registrations_mode != 'none' && !Rails.configuration.x.single_user_mode
 | 
					    Setting.registrations_mode != 'none' && !Rails.configuration.x.single_user_mode
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def metadata
 | 
				
			||||||
 | 
					    []
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  private
 | 
					  private
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def instance_presenter
 | 
					  def instance_presenter
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue