New basket table, add empty state on basket page, new BasketItemModel

This commit is contained in:
tobias committed 2024-09-09 19:47:46 +02:00
1 parent dff6992db3
commit 40586f18b2
14 files changed
+190 -68

No files matched your search

+8 -1
View File
@@ -3,10 +3,17 @@ import { Product } from "../models/product.model";
export const product = Router()
product.get("/", (req: Request, res: Response, next: NextFunction)=> {
product.get("/", (req: Request, res: Response, next: NextFunction) => {
Product.findAll()
.then(products => {
res.json(products)
})
.catch(next)
})
product.get("/:productId", (req: Request, res: Response, next: NextFunction) => {
Product.findByPk(req.params.productId)
.then(product => {
res.json(product)
})
})