Explorar o código

修改返回文案

llp hai 1 día
pai
achega
e0da29122f

+ 2 - 4
packages/Longyi/Gift/src/Http/Controllers/Shop/GiftController.php

@@ -114,7 +114,7 @@ class GiftController extends Controller
                ->where('customer_id', $customerId)->first();
            $cart = Cart::getCart();
            if (!$giftCard) {
-               return ApiResponse::error('Coupon not found.');
+               return ApiResponse::error('giftcard not found.');
            }
            $remainingGiftcardAmount = core()->convertPrice($giftCard->remaining_giftcard_amount);
            if ($remainingGiftcardAmount <= 0) {
@@ -162,9 +162,7 @@ class GiftController extends Controller
         }
 
         // Return response with updated cart data
-        return ApiResponse::success([
-                'data'     => new CustomCartResource(Cart::getCart())
-            ], trans('gift::app.giftcard.remove'));
+        return ApiResponse::success(new CustomCartResource(Cart::getCart()), trans('gift::app.giftcard.remove'));
     }
 
     /**