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.
|
|
|
const express = require('express');
|
|
|
|
const router = express.Router();
|
|
|
|
const cartController = require('../controllers/cart');
|
|
|
|
const auth = require("../auth");
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
module.exports = router;
|