Admin Order Page, refresh ERM diagram of database

This commit is contained in:
2024-11-09 15:19:08 +01:00
parent 47992b92c9
commit 9875b99631
9 changed files with 550 additions and 394 deletions

View File

@@ -2,6 +2,7 @@
"orders": [
{
"username": "hagemeister93",
"shipped": true,
"tickets": [
{
"date": "2024-10-18",

View File

@@ -1,4 +1,4 @@
import { AutoIncrement, Column, ForeignKey, Model, PrimaryKey, Table, Unique } from "sequelize-typescript";
import { Column, ForeignKey, Model, PrimaryKey, Table } from "sequelize-typescript";
import { Genre } from "./genre.model";
import { Band } from "./band.model";

View File

@@ -10,12 +10,35 @@ import { City } from "../models/locations/city.model";
import { Seat } from "../models/locations/seat.model";
import { SeatRow } from "../models/locations/seatRow.model";
import { SeatGroup } from "../models/locations/seatGroup.model";
import { Account } from "../models/user/account.model";
export const order = Router()
// Get all orders
order.get("/", (req: Request, res: Response) => {
Order.findAll()
Order.findAll({
include: [
Account,
Address,
{
model: Ticket,
include: [
{
model: Concert,
include: [
{
model: Band
},
{
model: Location,
include: [ City ]
}
]
}
]
}
]
})
.then(orders => {
res.status(200).json(orders)
})