From b06b81f140311301db2e55adf7c39a98f5818251 Mon Sep 17 00:00:00 2001 From: TobiZog Date: Tue, 5 Nov 2024 18:43:47 +0100 Subject: [PATCH] Error page --- software/backend/routes/band.routes.ts | 3 ++ software/backend/routes/concert.routes.ts | 3 ++ software/backend/routes/location.routes.ts | 3 ++ software/backend/routes/order.routes.ts | 1 - software/src/App.vue | 9 +++++ .../src/components/basics/actionDialog.vue | 4 ++ software/src/locales/de.json | 6 ++- software/src/locales/en.json | 4 ++ .../src/pages/bands/bandDetailPage/index.vue | 10 ++++- .../concerts/concertBookingPage/index.vue | 9 ++++- .../src/pages/concerts/concertsPage/index.vue | 8 ++-- .../locations/locationDetailPage/index.vue | 9 ++++- .../pages/misc/basketPage/orderingDialog.vue | 38 +++++++++++++++---- software/src/pages/misc/errorPage/index.vue | 17 +++++++++ software/src/router/routes.ts | 12 +++++- software/src/stores/band.store.ts | 4 ++ software/src/stores/concert.store.ts | 5 +++ software/src/stores/feedback.store.ts | 5 ++- software/src/stores/location.store.ts | 5 +++ 19 files changed, 136 insertions(+), 19 deletions(-) create mode 100644 software/src/pages/misc/errorPage/index.vue diff --git a/software/backend/routes/band.routes.ts b/software/backend/routes/band.routes.ts index 4267a19..6c0a322 100644 --- a/software/backend/routes/band.routes.ts +++ b/software/backend/routes/band.routes.ts @@ -117,6 +117,9 @@ band.get("/band/:name", (req: Request, res: Response) => { res.status(200).json(band) }) + .catch(e => { + res.status(404).send() + }) }) diff --git a/software/backend/routes/concert.routes.ts b/software/backend/routes/concert.routes.ts index cca6830..c0a6654 100644 --- a/software/backend/routes/concert.routes.ts +++ b/software/backend/routes/concert.routes.ts @@ -110,6 +110,9 @@ concert.get("/concert/:id", (req: Request, res: Response) => { res.status(200).json(concert) }) + .catch(e => { + res.status(404).send() + }) }) diff --git a/software/backend/routes/location.routes.ts b/software/backend/routes/location.routes.ts index cda05ef..12a4b17 100644 --- a/software/backend/routes/location.routes.ts +++ b/software/backend/routes/location.routes.ts @@ -98,6 +98,9 @@ location.get("/location/:urlName", (req: Request, res: Response) => { res.status(200).json(location) }) + .catch(e => { + res.status(404).send() + }) }) diff --git a/software/backend/routes/order.routes.ts b/software/backend/routes/order.routes.ts index 62b1a93..ea11673 100644 --- a/software/backend/routes/order.routes.ts +++ b/software/backend/routes/order.routes.ts @@ -61,7 +61,6 @@ order.get("/:id", (req: Request, res: Response) => { // Place a new order order.post("/", (req: Request, res: Response) => { - console.log(req.body.tickets) Order.create(req.body) .then(async order => { for (let ticket of req.body.tickets) { diff --git a/software/src/App.vue b/software/src/App.vue index 461bc97..345b01b 100644 --- a/software/src/App.vue +++ b/software/src/App.vue @@ -8,10 +8,12 @@ import { usePreferencesStore } from './stores/preferences.store'; import { useFeedbackStore } from './stores/feedback.store'; import companyFooter from './components/navigation/companyFooter.vue'; import urlBar from './components/navigation/urlBar.vue'; +import { useRouter } from 'vue-router'; const preferencesStore = usePreferencesStore() const feedbackStore = useFeedbackStore() const theme = useTheme() +const router = useRouter() theme.global.name.value = preferencesStore.theme @@ -20,6 +22,13 @@ theme.global.name.value = preferencesStore.theme watch(() => preferencesStore.language, () => { i18n.global.locale = preferencesStore.language }, { immediate: true }) + +watch(() => feedbackStore.notFound, () => { + if (feedbackStore.notFound) { + feedbackStore.notFound = false + router.push("/404") + } +})