New basket table, add empty state on basket page, new BasketItemModel
This commit is contained in:
1 parent
6ff577ece1
commit
7ebc3c1c77
14 files changed
+190
-68
No files matched your search
@@ -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)
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user