You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
701 B
JavaScript

11 months ago
const express = require('express');
const router = express.Router();
const cartController = require('../controllers/cart');
const auth = require("../auth");
11 months ago
const { authenticateToken } = auth;
// Route to add an item to the cart
router.post('/add-to-cart', authenticateToken, cartController.addToCart);
// Route to update product quantity in the cart
router.put('/update-quantity', authenticateToken, cartController.updateQuantity);
// Route to remove a product from the cart
router.delete('/remove-from-cart', authenticateToken, cartController.removeFromCart);
// Route to get cart details
router.get('/cart-details', authenticateToken, cartController.getCartDetails);
11 months ago
module.exports = router;