Improve filterBar on eventsPage, improve API access from frontend

This commit is contained in:
2024-10-03 19:56:44 +02:00
parent 2b7e87a68d
commit c611cc04fc
27 changed files with 170 additions and 164 deletions

View File

@@ -78,8 +78,6 @@ account.post("/", (req: Request, res: Response) => {
})
account.patch("/", (req: Request, res: Response) => {
console.log(req.body)
Account.update(req.body,
{
where: { id: req.body.id }

View File

@@ -6,14 +6,7 @@ import { Request, Response, Router } from "express";
export const genre = Router()
genre.get("/", (req: Request, res: Response) => {
Genre.findAll({
include: [
{
model: Band,
include: [ Rating ]
}
]
})
Genre.findAll()
.then(genres => {
res.status(200).json(genres)
})

View File

@@ -38,12 +38,12 @@ location.get("/", (req: Request, res: Response) => {
.then(async locations => {
for (let location of locations) {
for (let concert of location.dataValues.concerts) {
let tour = concert.dataValues.tour
let event = concert.dataValues.event
await Band.findByPk(tour.dataValues.bandId)
await Band.findByPk(event.dataValues.bandId)
.then(band => {
tour.dataValues.bandName = band.dataValues.name
delete tour.dataValues.bandId
event.dataValues.bandName = band.dataValues.name
delete event.dataValues.bandId
})
}
}