Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: dcade416c7
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (27 sloc) 0.755 kb
require 'sinatra'
require 'sinatra/activerecord'
require 'scoped_search'
require 'json'
require 'model/subscription'
require 'model/organization'
require 'config/settings.rb'
module MiniSearch
get '/candlepin/pools' do
begin
res = Subscription.my_subscription("#{params[:owner]}").search_for("#{params[:search]}")
rescue ScopedSearch::QueryNotSupported => e
res = Subscription.my_subscription("#{params[:owner]}").all
end
content_type :json
res.to_json
end
get '/candlepin/pools/auto_complete_search' do
begin
res = Subscription.complete_for("#{params[:search]}")
rescue ScopedSearch::QueryNotSupported => e
res = [{:error =>e.to_s}]
end
content_type :json
res.to_json
end
end
Jump to Line
Something went wrong with that request. Please try again.