Skip to content
Snippets Groups Projects
Commit 041f8832 authored by Mateus Rambo Strey's avatar Mateus Rambo Strey
Browse files

change search controller received types and tags to array format

parent 45c9e03b
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,6 @@ class V1::SearchController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def search_params
params.permit(:page, :results_per_page, :order, :query, :search_class, :tags, :types)
params.permit(:page, :results_per_page, :order, :query, :search_class, tags: [], types: [])
end
end
......@@ -18,8 +18,8 @@ module SearchService
def where_hash
hash = {}
hash[:tags] = { all: @search.tags.split(',').collect(&:strip) } unless @search.tags.blank?
hash[:object_type] = @search.types.split(',').collect(&:strip) unless @search.types.blank?
hash[:tags] = @search.tags unless @search.tags.blank?
hash[:object_type] = @search.types unless @search.types.blank?
hash[:state] = validate_object
hash.blank? ? nil : hash
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment