diff --git a/app/controllers/api/v0/products_controller.rb b/app/controllers/api/v0/products_controller.rb index eead37ca494c..1a72047d73a8 100644 --- a/app/controllers/api/v0/products_controller.rb +++ b/app/controllers/api/v0/products_controller.rb @@ -42,6 +42,7 @@ def destroy authorize! :delete, Spree::Product @product = product_finder.find_product authorize! :delete, @product + @product.destroyed_by = current_api_user @product.destroy render json: @product, serializer: Api::Admin::ProductSerializer, status: :no_content end diff --git a/app/models/spree/product.rb b/app/models/spree/product.rb index 4fd670f90e59..d760c329ec1b 100755 --- a/app/models/spree/product.rb +++ b/app/models/spree/product.rb @@ -23,6 +23,7 @@ module Spree class Product < ApplicationRecord include ProductStock + include LogDestroyPerformer self.belongs_to_required_by_default = false