Remove EventTable in database, redesign frontend URL paths

This commit is contained in:
2024-10-12 15:54:03 +02:00
parent 7b991d2ff8
commit 60e217db03
40 changed files with 955 additions and 1203 deletions

View File

@@ -3,7 +3,6 @@ import { Band } from "../models/acts/band.model";
import { Request, Response, Router } from "express";
import { Rating } from "../models/acts/rating.model";
import { Genre } from "../models/acts/genre.model";
import { Event } from "../models/acts/event.model";
import { Concert } from "../models/acts/concert.model";
import { Location } from "../models/locations/location.model";
import { City } from "../models/locations/city.model";
@@ -28,26 +27,18 @@ band.get("/", (req: Request, res: Response) => {
}
},
{
model: Event,
model: Concert,
include: [
{
model: Concert,
include: [
{
model: Location,
include: [ City ],
attributes: {
exclude: [ "id" ]
}
}
],
model: Location,
include: [ City ],
attributes: {
exclude: [ "id", "tourId", "locationId" ]
exclude: [ "id" ]
}
}
],
attributes: {
exclude: [ "id", "bandId" ]
exclude: [ "id", "tourId", "locationId" ]
}
},
Genre
@@ -78,26 +69,18 @@ band.get("/band/:name", (req: Request, res: Response) => {
}
},
{
model: Event,
model: Concert,
include: [
{
model: Concert,
include: [
{
model: Location,
include: [ City ],
attributes: {
exclude: [ "id" ]
}
}
],
model: Location,
include: [ City ],
attributes: {
exclude: [ "tourId", "locationId" ]
exclude: [ "id" ]
}
}
],
attributes: {
exclude: [ "bandId" ]
exclude: [ "tourId", "locationId" ]
}
},
Genre
@@ -120,17 +103,7 @@ band.get("/search", (req: Request, res: Response) => {
[Op.substring]: req.query.value
},
},
include: [
{
model: Event,
include: [
Concert
]
},
{
model: Genre
}
]
include: [ Concert, Genre ]
})
.then(bands => {
res.status(200).json(bands)