From bd33a56a332c0effd3291c05f90d7600c537942b Mon Sep 17 00:00:00 2001 From: xxl4 Date: Fri, 17 Jan 2025 05:32:30 +0000 Subject: [PATCH] fix cache --- .../Controllers/Api/V1/Admin/Catalog/ProductController.php | 4 ---- .../V1/Admin/Marketing/Promotions/CartRuleController.php | 7 +++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Http/Controllers/Api/V1/Admin/Catalog/ProductController.php b/src/Http/Controllers/Api/V1/Admin/Catalog/ProductController.php index 80849e4..2d58f03 100644 --- a/src/Http/Controllers/Api/V1/Admin/Catalog/ProductController.php +++ b/src/Http/Controllers/Api/V1/Admin/Catalog/ProductController.php @@ -388,10 +388,6 @@ public function quickCreate(Request $request){ $images = $request->input('images'); - - - - // add images to the product $productImages = []; foreach($images as $key=>$image) { diff --git a/src/Http/Controllers/Api/V1/Admin/Marketing/Promotions/CartRuleController.php b/src/Http/Controllers/Api/V1/Admin/Marketing/Promotions/CartRuleController.php index f00be8c..21e1309 100644 --- a/src/Http/Controllers/Api/V1/Admin/Marketing/Promotions/CartRuleController.php +++ b/src/Http/Controllers/Api/V1/Admin/Marketing/Promotions/CartRuleController.php @@ -8,9 +8,11 @@ use NexaMerchant\Apis\Http\Controllers\Api\V1\Admin\Marketing\MarketingController; use NexaMerchant\Apis\Http\Resources\Api\V1\Admin\Marketing\Promotions\CartRuleResource; use Illuminate\Support\Facades\Redis; +use Illuminate\Support\Facades\Cache; class CartRuleController extends MarketingController { + private $checkout_v2_cache_key = "checkout_v2_cache_"; /** * Repository class name. */ @@ -369,6 +371,11 @@ public function createProductQuantityRule($product_id, Request $request){ } + // clear the cache in redis + // product slug + $slug = $product->url_key; + Cache::forget($this->checkout_v2_cache_key.$slug); + return response([ 'message' => trans('Apis::app.admin.marketing.promotions.cart-rules.create-success'), ]);