mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-31 21:37:16 +00:00
Authorize product and not @product
This commit is contained in:
@@ -7,7 +7,7 @@ module Api
|
||||
|
||||
def update_product_image
|
||||
product = Spree::Product.find(params[:product_id])
|
||||
authorize! :update, @product
|
||||
authorize! :update, product
|
||||
|
||||
image = product.images.first || Spree::Image.new(
|
||||
viewable_id: product.master.id,
|
||||
|
||||
Reference in New Issue
Block a user