Skip to content

Commit

Permalink
[api][webui] Fix and refactor Backend::File.query_from_list
Browse files Browse the repository at this point in the history
  • Loading branch information
Moises Deniz Aleman committed Apr 19, 2017
1 parent 2a25c7f commit e6b7509
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/api/lib/backend/file.rb
Expand Up @@ -112,9 +112,10 @@ def destroy(query = {})
end

# TODO: Replace SuseBackend.build_query_from_hash with this function asap
def self.query_from_list(params, key_list = [])
params = params.slice(*key_list)
"?#{params.to_query}"
def self.query_from_list(params, key_list = nil)
key_list ||= params.keys
query = params.slice(*key_list).to_query
query.present? ? "?#{query}" : query
end

private
Expand Down

0 comments on commit e6b7509

Please sign in to comment.