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},