Fix params issues in Api::TaxonsController

This commit is contained in:
Matt-Yorkley
2021-01-09 22:29:57 +00:00
parent c5feb19e5b
commit 7bf4f88034
2 changed files with 3 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ require "spree/core/controller_helpers/ssl"
module Api
class BaseController < ActionController::Metal
include RawParams
include ActionController::StrongParameters
include ActionController::RespondWith
include Spree::Api::ControllerSetup

View File

@@ -8,9 +8,9 @@ module Api
@taxons = if taxonomy
taxonomy.root.children
elsif params[:ids]
Spree::Taxon.where(id: params[:ids].split(","))
Spree::Taxon.where(id: raw_params[:ids].split(","))
else
Spree::Taxon.ransack(params[:q]).result
Spree::Taxon.ransack(raw_params[:q]).result
end
render json: @taxons, each_serializer: Api::TaxonSerializer
end