removed stok quantity, added hide/show function to brand field

This commit is contained in:
Jelaletdin12
2026-02-01 21:50:41 +05:00
parent a143c2e18b
commit fcb016589b
3 changed files with 19 additions and 25 deletions

View File

@@ -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];