From 2c8cad52a74f5b462e3ed27f0a79ae6a8d9981bc Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Wed, 4 Feb 2026 13:15:09 +0100 Subject: [PATCH] feat(router): enhance club loading logic and update route parameter naming - Refactored the loadClub method to handle club creation and permission checks, improving navigation based on user roles. - Updated the route parameter from ':1' to ':clubId' in the router configuration for better clarity and consistency. --- frontend/src/App.vue | 13 +++++++++++-- frontend/src/router.js | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index eb9b6095..3fba4fbe 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -305,8 +305,17 @@ export default { } }, - loadClub() { - this.setCurrentClub(this.selectedClub); + async loadClub() { + await this.setCurrentClub(this.selectedClub); + if (this.selectedClub === 'new') { + this.$router.push('/createclub'); + return; + } + // Wenn keine Berechtigung, auf Club-Ansicht mit Anfrage-Button + if (!this.hasPermission('statistics', 'read')) { + this.$router.push(`/showclub/${this.selectedClub}`); + return; + } this.$router.push('/training-stats'); }, diff --git a/frontend/src/router.js b/frontend/src/router.js index 1386a0b4..b12d570a 100644 --- a/frontend/src/router.js +++ b/frontend/src/router.js @@ -28,7 +28,7 @@ const routes = [ { path: '/activate/:activationCode', component: Activate }, { path: '/', component: Home }, { path: '/createclub', component: CreateClub }, - { path: '/showclub/:1', component: ClubView }, + { path: '/showclub/:clubId', component: ClubView }, { path: '/members', component: MembersView }, { path: '/diary', component: DiaryView }, { path: '/pending-approvals', component: PendingApprovalsView},