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.
This commit is contained in:
@@ -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');
|
||||
},
|
||||
|
||||
|
||||
@@ -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},
|
||||
|
||||
Reference in New Issue
Block a user