New basket table, add empty state on basket page, new BasketItemModel
This commit is contained in:
@@ -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