From 2b509774b82ceae346b1c02e6d9895e4ecfa1f57 Mon Sep 17 00:00:00 2001 From: Gabriellvl Date: Sat, 22 Mar 2025 00:59:37 +0100 Subject: [PATCH] feat: tan stack theme query --- backend/src/controllers/themes.ts | 6 ++ frontend/package.json | 8 +- frontend/src/components/BrowseThemes.vue | 98 ++++++++------------ frontend/src/main.ts | 13 +++ frontend/src/queries/themes.ts | 25 +++++ package-lock.json | 111 +++++++++++++++++++++++ 6 files changed, 197 insertions(+), 64 deletions(-) create mode 100644 frontend/src/queries/themes.ts diff --git a/backend/src/controllers/themes.ts b/backend/src/controllers/themes.ts index 61a1a834..4cfbaa60 100644 --- a/backend/src/controllers/themes.ts +++ b/backend/src/controllers/themes.ts @@ -23,6 +23,12 @@ export function getThemes(req: Request, res: Response) { export function getThemeByTitle(req: Request, res: Response) { const themeKey = req.params.theme; + + if (!theme) { + res.status(400).json({ error: 'Missing required field: theme' }); + return; + } + const theme = themes.find((t) => t.title === themeKey); if (theme) { diff --git a/frontend/package.json b/frontend/package.json index ac1efc4a..e8133004 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -16,12 +16,14 @@ "test:e2e": "playwright test" }, "dependencies": { + "@tanstack/react-query": "^5.69.0", + "@tanstack/vue-query": "^5.69.0", + "axios": "^1.8.2", + "oidc-client-ts": "^3.1.0", "vue": "^3.5.13", "vue-i18n": "^11.1.2", "vue-router": "^4.5.0", - "vuetify": "^3.7.12", - "oidc-client-ts": "^3.1.0", - "axios": "^1.8.2" + "vuetify": "^3.7.12" }, "devDependencies": { "@playwright/test": "^1.50.1", diff --git a/frontend/src/components/BrowseThemes.vue b/frontend/src/components/BrowseThemes.vue index d3edcc89..eeea2c81 100644 --- a/frontend/src/components/BrowseThemes.vue +++ b/frontend/src/components/BrowseThemes.vue @@ -1,76 +1,52 @@ +