diff --git a/software/backend/routes/band.routes.ts b/software/backend/routes/band.routes.ts index f6aeafa..bc4a9f5 100644 --- a/software/backend/routes/band.routes.ts +++ b/software/backend/routes/band.routes.ts @@ -13,6 +13,9 @@ export const band = Router() // Get all bands band.get("/", (req: Request, res: Response) => { + let sort = req.query.sort + let count = req.query.count + Band.findAll({ include: [ { @@ -35,13 +38,28 @@ band.get("/", (req: Request, res: Response) => { // Delete unnecessary Arrays delete band.dataValues.ratings - delete band.dataValues.concerts for (let genre of band.dataValues.genres) { delete genre.dataValues.BandGenre } } + // Sort ascending/descending by number of concerts + if (sort != undefined) { + bands.sort((band1, band2) => { + if (sort == "desc") { + return band2.dataValues.concerts.length - band1.dataValues.concerts.length + } else if (sort == "asc") { + return band1.dataValues.concerts.length - band2.dataValues.concerts.length + } + }) + } + + // Limit number of items + if (count != undefined) { + bands.splice(Number(count)) + } + res.status(200).json(bands) }) }) diff --git a/software/backend/routes/concert.routes.ts b/software/backend/routes/concert.routes.ts index 38ee75c..fe83466 100644 --- a/software/backend/routes/concert.routes.ts +++ b/software/backend/routes/concert.routes.ts @@ -12,6 +12,8 @@ export const concert = Router() concert.get("/", (req: Request, res: Response) => { + let count = req.query.count + Concert.findAll({ include: [ Band, Location ], order: [ @@ -19,6 +21,11 @@ concert.get("/", (req: Request, res: Response) => { ] }) .then(concerts => { + // Limit number of items + if (count != undefined) { + concerts.splice(Number(count)) + } + res.status(200).json(concerts) }) }) diff --git a/software/backend/routes/location.routes.ts b/software/backend/routes/location.routes.ts index e77b5fd..b8e19d1 100644 --- a/software/backend/routes/location.routes.ts +++ b/software/backend/routes/location.routes.ts @@ -27,6 +27,7 @@ location.get("/", (req: Request, res: Response) => { } }) .then(async locations => { + // Sort ascending/descending by number of concerts if (sort != undefined) { locations.sort((location1, location2) => { if (sort == "desc") { diff --git a/software/backend/scripts/databaseHelper.ts b/software/backend/scripts/databaseHelper.ts index 0650dea..b53c135 100644 --- a/software/backend/scripts/databaseHelper.ts +++ b/software/backend/scripts/databaseHelper.ts @@ -226,7 +226,7 @@ export async function prepopulateDatabase() { date: concert.date, name: concertGroup.name, price: concert.price, - image: concertGroup.name, + image: concertGroup.image, inStock: concert.inStock, offered: true, bandId: dataset.dataValues.id, diff --git a/software/src/components/navigation/navigationAppendItems.vue b/software/src/components/navigation/navigationAppendItems.vue index 025090a..47ffd03 100644 --- a/software/src/components/navigation/navigationAppendItems.vue +++ b/software/src/components/navigation/navigationAppendItems.vue @@ -1,7 +1,6 @@ - + - + - - - - - - - {{ concert.location.name }} - - - - {{ band.name }} - {{ band.events[0].name }} - - - - - - + + + + + \ No newline at end of file diff --git a/software/src/pages/bands/bandDetailPage/gallerySection.vue b/software/src/pages/bands/bandDetailPage/gallerySection.vue index 913517d..ff420ea 100644 --- a/software/src/pages/bands/bandDetailPage/gallerySection.vue +++ b/software/src/pages/bands/bandDetailPage/gallerySection.vue @@ -1,8 +1,8 @@ @@ -49,8 +36,8 @@ getBand(String(router.currentRoute.value.params.bandName).replaceAll('-', ' ')) @@ -59,7 +46,9 @@ getBand(String(router.currentRoute.value.params.bandName).replaceAll('-', ' ')) - + @@ -68,7 +57,10 @@ getBand(String(router.currentRoute.value.params.bandName).replaceAll('-', ' ')) - + @@ -77,7 +69,9 @@ getBand(String(router.currentRoute.value.params.bandName).replaceAll('-', ' ')) - + diff --git a/software/src/pages/bands/bandDetailPage/ratingSection.vue b/software/src/pages/bands/bandDetailPage/ratingSection.vue index 892dbf2..8dd4119 100644 --- a/software/src/pages/bands/bandDetailPage/ratingSection.vue +++ b/software/src/pages/bands/bandDetailPage/ratingSection.vue @@ -1,9 +1,15 @@ - Bands + + + + + + + + Filterbar + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/software/src/pages/concerts/concertBookingPage/index.vue b/software/src/pages/concerts/concertBookingPage/index.vue index 9f5fd48..75e52ef 100644 --- a/software/src/pages/concerts/concertBookingPage/index.vue +++ b/software/src/pages/concerts/concertBookingPage/index.vue @@ -1,30 +1,17 @@ @@ -42,14 +29,16 @@ getConcert(Number(router.currentRoute.value.params.id)) - {{ concertModel.location.name }} + {{ concertStore.concert.location.name }} @@ -62,7 +51,7 @@ getConcert(Number(router.currentRoute.value.params.id)) - + @@ -102,15 +91,15 @@ getConcert(Number(router.currentRoute.value.params.id)) - + diff --git a/software/src/pages/concerts/concertsPage/index.vue b/software/src/pages/concerts/concertsPage/index.vue index 97a69f3..c23db7b 100644 --- a/software/src/pages/concerts/concertsPage/index.vue +++ b/software/src/pages/concerts/concertsPage/index.vue @@ -1,12 +1,10 @@ @@ -25,7 +23,7 @@ concertStore.getConcerts() diff --git a/software/src/pages/events/eventsPage/filterBar.vue b/software/src/pages/events/eventsPage/filterBar.vue deleted file mode 100644 index b9db999..0000000 --- a/software/src/pages/events/eventsPage/filterBar.vue +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - {{ $t('filtering') }} - - - - - \ No newline at end of file diff --git a/software/src/pages/events/eventsPage/index.vue b/software/src/pages/events/eventsPage/index.vue deleted file mode 100644 index 2575d4b..0000000 --- a/software/src/pages/events/eventsPage/index.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - Loading... - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/software/src/pages/homePage/highlightCarousel.vue b/software/src/pages/homePage/highlightCarousel.vue index 43fac7d..278a415 100644 --- a/software/src/pages/homePage/highlightCarousel.vue +++ b/software/src/pages/homePage/highlightCarousel.vue @@ -10,7 +10,7 @@ shoppingStore.getEvents() - - + --> - @@ -60,7 +60,7 @@ shoppingStore.getEvents() - + -->
{{ concertModel.location.name }}
{{ concertStore.concert.location.name }}