New locationDetailPage displays concert in a location, new datasets, images, URL path changed

This commit is contained in:
2024-09-29 21:42:20 +02:00
parent 04678f9913
commit 142d574f78
39 changed files with 493 additions and 515 deletions

View File

@@ -426,6 +426,59 @@
"bandId": 6
}
]
},
{
"id": 7,
"name": "Muse",
"foundingYear": 1994,
"descriptionEn": "Muse are an English rock band from Teignmouth, Devon, formed in 1994. The band consists of Matt Bellamy (lead vocals, guitar, keyboards), Chris Wolstenholme (bass guitar, backing vocals), and Dominic Howard (drums, percussion).",
"descriptionDe": "Muse ist eine britische Rockband, die 1994 in Teignmouth, England gegründet wurde. Die Band besteht aus Matthew Bellamy (Gesang, Gitarre, Klavier und Synthesizers), Chris Wolstenholme (E-Bass, Gesang, Synthesizer) und Dominic Howard (Schlagzeug und Perkussion). Muse verbindet stilistisch Alternative, Hard und Progressive Rock sowie Electronica mit Elementen klassischer Musik zu Rockballaden und wird dem Subgenre New Prog zugeordnet.",
"images": [
"muse-1.jpg",
"muse-2.jpg",
"muse-3.jpg"
],
"imageMembers": "muse-members.jpg",
"logo": "muse-logo.jpg",
"genreId": [
2,
15,
16
],
"members": [
{
"name": "Matthew Bellamy",
"bandId": 7,
"image": "matthew-bellamy.jpg"
},
{
"name": "Dominic Howard",
"bandId": 7,
"image": "dominic-howard.jpg"
},
{
"name": "Chris Wolstenholme",
"bandId": 7,
"image": "christ-wolstenholme.jpg"
}
],
"ratings": [
{
"accountId": 0,
"rating": 5,
"bandId": 7
},
{
"accountId": 1,
"rating": 4,
"bandId": 7
},
{
"accountId": 2,
"rating": 4,
"bandId": 7
}
]
}
]
}

View File

@@ -4,7 +4,6 @@
"id": 0,
"name": "Hannover",
"country": "Germany",
"image": "hannover.jpg",
"locations": [
{
"id": 0,
@@ -40,7 +39,6 @@
"id": 1,
"name": "München",
"country": "Germany",
"image": "munich.jpg",
"locations": [
{
"id": 4,
@@ -69,7 +67,6 @@
"id": 2,
"name": "Hamburg",
"country": "Germany",
"image": "hamburg.jpg",
"locations": [
{
"id": 7,
@@ -105,7 +102,6 @@
"id": 3,
"name": "Berlin",
"country": "Germany",
"image": "berlin.jpg",
"locations": [
{
"id": 11,

View File

@@ -59,6 +59,14 @@
{
"id": 14,
"name": "Bluesrock"
},
{
"id": 15,
"name": "New Prog"
},
{
"id": 16,
"name": "Hard Rock"
}
]
}

View File

@@ -11,12 +11,20 @@
"id": 0,
"date": "2024-10-18",
"price": 92,
"inStock": 930,
"inStock": 0,
"locationId": 0,
"tourId": 0
},
{
"id": 1,
"date": "2024-10-19",
"price": 92,
"inStock": 170,
"locationId": 0,
"tourId": 0
},
{
"id": 2,
"date": "2024-10-23",
"price": 119.90,
"inStock": 8736,
@@ -24,7 +32,7 @@
"tourId": 0
},
{
"id": 2,
"id": 3,
"date": "2024-10-26",
"price": 114.90,
"inStock": 2793,
@@ -32,7 +40,7 @@
"tourId": 0
},
{
"id": 3,
"id": 4,
"date": "2024-11-02",
"price": 124.90,
"inStock": 3079,
@@ -49,7 +57,7 @@
"image": "the-bends-tour.jpg",
"concerts": [
{
"id": 4,
"id": 5,
"date": "2024-11-30",
"price": 108,
"inStock": 1200,
@@ -57,7 +65,7 @@
"tourId": 1
},
{
"id": 5,
"id": 6,
"date": "2024-12-01",
"price": 104,
"inStock": 1800,
@@ -65,7 +73,7 @@
"tourId": 1
},
{
"id": 6,
"id": 7,
"date": "2024-12-07",
"price": 99.90,
"inStock": 2438,
@@ -82,7 +90,7 @@
"image": "european-tour-arctic-monkeys.jpg",
"concerts": [
{
"id": 7,
"id": 8,
"date": "2025-01-21",
"price": 67.90,
"inStock": 994,
@@ -90,7 +98,7 @@
"tourId": 2
},
{
"id": 8,
"id": 9,
"date": "2024-11-15",
"price": 79.90,
"inStock": 1073,
@@ -107,7 +115,7 @@
"image": "music-of-the-spheres.png",
"concerts": [
{
"id": 9,
"id": 10,
"date": "2024-12-07",
"price": 124.90,
"inStock": 765,
@@ -115,7 +123,7 @@
"tourId": 3
},
{
"id": 10,
"id": 11,
"date": "2025-01-17",
"price": 129.90,
"inStock": 989,
@@ -123,7 +131,7 @@
"tourId": 3
},
{
"id": 11,
"id": 12,
"date": "2025-02-01",
"price": 134.90,
"inStock": 827,
@@ -140,7 +148,7 @@
"image": "but-here-we-are.jpg",
"concerts": [
{
"id": 12,
"id": 13,
"date": "2024-12-05",
"price": 80,
"inStock": 99,
@@ -157,7 +165,7 @@
"image": "crisis-of-faith-tour.jpg",
"concerts": [
{
"id": 13,
"id": 14,
"date": "2025-01-12",
"price": 81.90,
"inStock": 173,
@@ -165,7 +173,7 @@
"tourId": 5
},
{
"id": 14,
"id": 15,
"date": "2025-02-01",
"price": 84.90,
"inStock": 192,
@@ -182,7 +190,7 @@
"image": "back-to-the-water-below.jpg",
"concerts": [
{
"id": 15,
"id": 16,
"date": "2025-02-27",
"price": 67.90,
"inStock": 847,
@@ -190,7 +198,7 @@
"tourId": 6
},
{
"id": 16,
"id": 17,
"date": "2025-03-06",
"price": 64.90,
"inStock": 245,
@@ -198,6 +206,47 @@
"tourId": 6
}
]
},
{
"id": 7,
"name": "Will of the People Tour",
"bandId": 7,
"offered": true,
"image": "will-of-the-people-tour.jpg",
"concerts": [
{
"id": 18,
"date": "2025-01-15",
"price": 67.90,
"inStock": 847,
"locationId": 2,
"tourId": 7
},
{
"id": 19,
"date": "2025-01-23",
"price": 64.90,
"inStock": 245,
"locationId": 10,
"tourId": 7
},
{
"id": 20,
"date": "2025-02-02",
"price": 64.90,
"inStock": 245,
"locationId": 13,
"tourId": 7
},
{
"id": 21,
"date": "2025-02-05",
"price": 64.90,
"inStock": 245,
"locationId": 13,
"tourId": 7
}
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 426 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

View File

@@ -9,9 +9,6 @@ export class City extends Model {
@Column
country: String
@Column
image: String
// Relations

View File

@@ -21,7 +21,7 @@ export class Location extends Model {
// Relations
@HasMany(() => Concert)
shows: Concert[]
concerts: Concert[]
@BelongsTo(() => City)
city: City

View File

@@ -1,14 +1,26 @@
import { Location } from "../models/acts/location.model";
import { City } from "../models/acts/city.model";
import { Request, Response, Router } from "express";
import { Concert } from "../models/acts/concert.model";
export const city = Router()
city.get("/", (req: Request, res: Response) => {
City.findAll({
include: [ Location ]
include: [
{
model: Location,
include: [ Concert ]
}
]
})
.then(cities => {
for (let city of cities) {
for (let location of city.dataValues.locations) {
location.dataValues.nrOfConcerts = location.dataValues.concerts.length
delete location.dataValues.concerts
}
}
res.status(200).json(cities)
})
})

View File

@@ -1,17 +1,41 @@
import { Concert } from "../models/acts/concert.model";
import { City } from "../models/acts/city.model";
import { Location } from "../models/acts/location.model";
import { Request, Response, Router } from "express";
import { Tour } from "../models/acts/tour.model";
import { Band } from "../models/acts/band.model";
export const location = Router()
location.get("/", (req: Request, res: Response) => {
Location.findAll({
include: [ City ],
include: [
City,
{
model: Concert,
include: [ Tour ],
attributes: {
exclude: [ "locationId", "tourId" ]
}
}
],
attributes: {
exclude: [ "cityId" ]
}
})
.then(locations => {
.then(async locations => {
for (let location of locations) {
for (let concert of location.dataValues.concerts) {
let tour = concert.dataValues.tour
await Band.findByPk(tour.dataValues.bandId)
.then(band => {
tour.dataValues.bandName = band.dataValues.name
delete tour.dataValues.bandId
})
}
}
res.status(200).json(locations)
})
})