Skip to content

Commit

Permalink
fix cache
Browse files Browse the repository at this point in the history
  • Loading branch information
xxl4 committed Jan 17, 2025
1 parent 2f8acac commit bd33a56
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,6 @@ public function quickCreate(Request $request){

$images = $request->input('images');





// add images to the product
$productImages = [];
foreach($images as $key=>$image) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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'),
]);
Expand Down

0 comments on commit bd33a56

Please sign in to comment.