Skip to content

Commit

Permalink
Add sponsors_logins action to OwnersController and update routes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed Nov 24, 2024
1 parent 76bb924 commit 6acc1aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/controllers/api/v1/owners_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
resources :owners, only:[:index, :show] do
collection do
get :lookup
get :sponsors_logins
end
member do
get :repositories
Expand Down

0 comments on commit 6acc1aa

Please sign in to comment.