Skip to content

Commit

Permalink
remove productRoutes authorization middleware from GET calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Zahkklm committed Dec 22, 2024
1 parent 3da6877 commit 6ccdf71
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/routes/productRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ router.patch('/:id', authMiddleware, authorizeRoles('admin'), updateProduct); //
router.delete('/:id', authMiddleware, authorizeRoles('admin'), deleteProduct); // Delete product (Admin only)

// Shared routes (Authenticated users)
router.get('/', authMiddleware, getAllProducts); // Get all products (Authenticated users)
router.get('/:id', authMiddleware, getProductById); // Get a single product by ID (Authenticated users)
router.get('/', getAllProducts); // Get all products (Authenticated users)
router.get('/:id', getProductById); // Get a single product by ID (Authenticated users)

module.exports = router;
module.exports = router;

0 comments on commit 6ccdf71

Please sign in to comment.