More skeleton loader, repair bandDetailPage

This commit is contained in:
2024-10-04 18:01:37 +02:00
parent e0a8748184
commit 519fa210e9
18 changed files with 262 additions and 93 deletions

View File

@@ -7,6 +7,7 @@ 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";
import { Op } from "sequelize";
export const band = Router()
@@ -58,8 +59,11 @@ band.get("/", (req: Request, res: Response) => {
})
// Get all information about one band
band.get("/:id", (req: Request, res: Response) => {
Band.findByPk(req.params.id, {
band.get("/:name", (req: Request, res: Response) => {
Band.findOne({
where: {
name: { [Op.like]: req.params.name }
},
include: [
{
model: Member,
@@ -73,6 +77,29 @@ band.get("/:id", (req: Request, res: Response) => {
exclude: [ "bandId" ]
}
},
{
model: Event,
include: [
{
model: Concert,
include: [
{
model: Location,
include: [ City ],
attributes: {
exclude: [ "id" ]
}
}
],
attributes: {
exclude: [ "id", "tourId", "locationId" ]
}
}
],
attributes: {
exclude: [ "id", "bandId" ]
}
},
Genre
],
attributes: {