From 25e3207b9e0561d0a21109487b8102d0d2c719a5 Mon Sep 17 00:00:00 2001 From: Mohamed ABDELLANI Date: Thu, 9 May 2024 14:39:36 +0100 Subject: [PATCH] included LogDestroyPerformer on product model --- app/controllers/api/v0/products_controller.rb | 1 + app/models/spree/product.rb | 1 + 2 files changed, 2 insertions(+) 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