浏览代码

Исправление корзины

Vadim 2 月之前
父节点
当前提交
00b857c09d
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/modules/client/shop/cart/cart-service.ts

+ 3 - 3
src/modules/client/shop/cart/cart-service.ts

@@ -62,7 +62,7 @@ class CartService {
         where
             ${"cartId" in entity ? sql.fragment`c.cart_id = ${entity.cartId}` : sql.fragment`c.user_id = ${entity.userId}`}
         `);
-    return CartShema.parse(cart);
+    return CartShema.nullable().parse(cart);
   }
 
   async getFullCart(
@@ -221,8 +221,8 @@ class CartService {
         ${item.cartId}, 
         ${item.productId}, 
         ${item.priceAtAddition}, 
-        ${item.activityRegId || null}, 
-        ${item.peMemberId || null}
+        ${item.activityRegId ?? null}, 
+        ${item.peMemberId ?? null}
       )
     `);
   }