Finish admin dashboard and update sql code

This commit is contained in:
estherdev03
2025-04-20 07:48:20 -06:00
parent e97f80aee1
commit 7a2250369e
8 changed files with 193 additions and 20 deletions

View File

@@ -7,6 +7,8 @@ const {
getAllProducts,
getProductById,
addProduct,
removeProduct,
getProductWithPagination,
} = require("../controllers/product");
const router = express.Router();
@@ -22,6 +24,12 @@ router.post("/delFavorite", removeFavorite);
router.post("/addProduct", addProduct);
router.get("/getProduct", getAllProducts);
//Remove product
router.delete("/:id", removeProduct);
//Get products with pagination
router.get("/getProductWithPagination", getProductWithPagination);
router.get("/:id", getProductById); // Simplified route
module.exports = router;