Admin Order Page, refresh ERM diagram of database
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
"orders": [
|
||||
{
|
||||
"username": "hagemeister93",
|
||||
"shipped": true,
|
||||
"tickets": [
|
||||
{
|
||||
"date": "2024-10-18",
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user