From da2631822f902094e691143302d6fc6b68e1cf56 Mon Sep 17 00:00:00 2001
From: HombreLaser <sebastian-440@live.com>
Date: Wed, 24 May 2023 20:18:00 -0600
Subject: Añade lógica de carrito
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/main.tsx | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'src/main.tsx')

diff --git a/src/main.tsx b/src/main.tsx
index ebe246a..147d913 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -8,7 +8,7 @@ import Account from "./routes/account/account";
 import Cart from "./routes/account/cart";
 import { EditAccount } from './routes/account/edit';
 import { Edit as EditAddress } from "./routes/account/addresses/edit";
-import { create, editAccount, authenticatedEdit } from './clients/actions';
+import { create, editAccount, authenticatedEdit, addToCart, deleteFromCart } from './clients/actions';
 import Layout from "./components/layout";
 import { accountLoader, loader, productLoader, addressLoader, cardLoader, cartLoader } from "./clients/loaders"; 
 import './index.css';
@@ -25,7 +25,8 @@ const routes = [
   {
     path: "products/:productId",
     loader: productLoader,
-    element: <Product/>
+    action: addToCart,
+    element: <Product/>,
   },
   {
     path: "/companies",
@@ -68,7 +69,8 @@ const routes = [
   {
     path: "/account/cart",
     element: <Cart/>,
-    loader: cartLoader
+    loader: cartLoader,
+    action: deleteFromCart
   },
   {
     path: '/',
-- 
cgit v1.2.3

