diff --git a/app/controllers/api/v1/owners_controller.rb b/app/controllers/api/v1/owners_controller.rb index 68dccbbd..bb2c1642 100644 --- a/app/controllers/api/v1/owners_controller.rb +++ b/app/controllers/api/v1/owners_controller.rb @@ -71,4 +71,10 @@ def lookup @pagy, @owners = pagy_countless(scope) fresh_when @owners, public: true end + + def sponsors_logins + @host = Host.find_by_name!(params[:host_id]) + @sponsors_logins = @host.owners.has_sponsors_listing.pluck(:login) + render json: @sponsors_logins + end end diff --git a/config/routes.rb b/config/routes.rb index 1563bed3..94ff222c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -30,6 +30,7 @@ resources :owners, only:[:index, :show] do collection do get :lookup + get :sponsors_logins end member do get :repositories