OrderStore

This commit is contained in:
2024-11-07 17:18:49 +01:00
parent fbae1b9f3a
commit 2c9b2cc509
12 changed files with 196 additions and 174 deletions

View File

@@ -13,6 +13,15 @@ import { SeatGroup } from "../models/locations/seatGroup.model";
export const order = Router()
// Get all orders
order.get("/", (req: Request, res: Response) => {
Order.findAll()
.then(orders => {
res.status(200).json(orders)
})
})
// Get all orders of one account by it's user id
order.get("/:id", (req: Request, res: Response) => {
Order.findAll({

View File

@@ -272,7 +272,7 @@ export async function prepopulateDatabase() {
date: concert.date,
name: concertGroup.name,
price: concert.price,
image: concertGroup.image,
image: "http://localhost:3000/static/" + concertGroup.image,
inStock: concert.inStock,
offered: true,
bandId: dataset.dataValues.id,