Skip to content

Commit

Permalink
[api] Refactor Backend::Api::Search
Browse files Browse the repository at this point in the history
...to use Backend::Api::Connection calls
  • Loading branch information
Moises Deniz Aleman committed Sep 29, 2017
1 parent 7f5f33e commit 80df6d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/api/lib/backend/api/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
module Backend
module Api
class Search
extend Backend::ConnectionHelper

# Performs a search of the binary in a project list
def self.binary(projects, name)
project_list = projects.map { |project| "@project='#{CGI.escape(project.name)}'" }.join('+or+')
Backend::Connection.post("/search/published/binary/id?match=(@name='#{CGI.escape(name)}'+and+(#{project_list}))").body
post("/search/published/binary/id?match=(@name='#{CGI.escape(name)}'+and+(#{project_list}))")
end
end
end
Expand Down

0 comments on commit 80df6d8

Please sign in to comment.