Commit a214320c by ivan Lan

Add manager to Merchant Product Controller

parent 0883e469
......@@ -5,8 +5,10 @@ module Shotengai
self.resources = Product
self.template_dir = 'shotengai/merchant/products/'
before_action :manager_auth
default_query do |resource, params|
resource.where(manager: @manager)
end
index_query do |resource, params|
......@@ -31,6 +33,10 @@ module Shotengai
end
private
def manager_auth
@manager = params[:manager_type].constantize.find(params[:manager_id])
end
def resource_params
# QUESTION: need these ?
spec = params.require(resource_key).fetch(:spec, nil).try(:permit!)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment