removed stok quantity, added hide/show function to brand field
This commit is contained in:
@@ -198,7 +198,6 @@ const CartPage = () => {
|
||||
const item = cartItems.find((item) => item.product.id === productId);
|
||||
if (!item) return;
|
||||
|
||||
// ✅ Stock kontrolü
|
||||
if (localQuantities[productId] >= item.product.stock) {
|
||||
return;
|
||||
}
|
||||
@@ -222,7 +221,6 @@ const CartPage = () => {
|
||||
|
||||
const currentQuantity = localQuantities[productId] || 0;
|
||||
|
||||
// ✅ 1'den azsa modal göster
|
||||
if (currentQuantity <= 1) {
|
||||
showDeleteConfirm(productId);
|
||||
return;
|
||||
@@ -267,7 +265,6 @@ const CartPage = () => {
|
||||
if (checkoutStores[storeId] && checkoutRefs.current[storeId]) {
|
||||
const success = await checkoutRefs.current[storeId]();
|
||||
if (success) {
|
||||
// ✅ RTK Query otomatik güncelleyecek, refetch'e gerek yok
|
||||
setCheckoutStores(prev => ({ ...prev, [storeId]: false }));
|
||||
}
|
||||
} else {
|
||||
@@ -295,9 +292,7 @@ const CartPage = () => {
|
||||
if (itemToDelete) {
|
||||
try {
|
||||
await removeFromCart({ productId: itemToDelete }).unwrap();
|
||||
// ✅ RTK Query otomatik cache'i güncelleyecek
|
||||
|
||||
// ✅ Local state'i de temizle
|
||||
setLocalQuantities((prev) => {
|
||||
const newState = { ...prev };
|
||||
delete newState[itemToDelete];
|
||||
|
||||
Reference in New Issue
Block a user