Creating whole Band details page

This commit is contained in:
2024-09-29 16:56:43 +02:00
parent 422a5e1722
commit f898c0c5b9
16 changed files with 294 additions and 111 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 KiB

View File

@@ -3,13 +3,54 @@ 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 { Tour } from "../models/acts/tour.model";
import { Concert } from "../models/acts/concert.model";
import { Location } from "../models/acts/location.model";
import { City } from "../models/acts/city.model";
export const band = Router()
// Get all bands
band.get("/", (req: Request, res: Response) => {
Band.findAll({
include: [ Genre, Rating ]
include: [
{
model: Member,
attributes: {
exclude: [ "id", "bandId" ]
}
},
{
model: Rating,
attributes: {
exclude: [ "id", "bandId" ]
}
},
{
model: Tour,
include: [
{
model: Concert,
include: [
{
model: Location,
include: [ City ],
attributes: {
exclude: [ "id" ]
}
}
],
attributes: {
exclude: [ "id", "tourId", "locationId" ]
}
}
],
attributes: {
exclude: [ "id", "bandId" ]
}
},
Genre
]
})
.then(bands => {
res.status(200).json(bands)