New page for all concerts
This commit is contained in:
@@ -20,15 +20,6 @@ location.get("/", (req: Request, res: Response) => {
|
||||
{
|
||||
model: Concert,
|
||||
include: [ Band ],
|
||||
},
|
||||
{
|
||||
model: SeatGroup,
|
||||
include: [
|
||||
{
|
||||
model: SeatRow,
|
||||
include: [ Seat ]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
attributes: {
|
||||
@@ -46,6 +37,12 @@ location.get("/", (req: Request, res: Response) => {
|
||||
})
|
||||
}
|
||||
|
||||
for (let location of locations) {
|
||||
location.dataValues["nrOfConcerts"] = location.dataValues.concerts.length
|
||||
delete location.dataValues.concerts
|
||||
}
|
||||
|
||||
// Limit number of items
|
||||
if (count != undefined) {
|
||||
locations.splice(Number(count))
|
||||
}
|
||||
@@ -86,7 +83,6 @@ location.get("/location/:urlName", (req: Request, res: Response) => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
res.status(200).json(location)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user