speaking routes

This commit is contained in:
Patrick Haßel 2024-10-29 11:26:30 +01:00
parent 14f1358528
commit 63231e0181
4 changed files with 7 additions and 10 deletions

View File

@ -49,7 +49,7 @@ export class UserService {
} }
goto(user: UserPublic) { goto(user: UserPublic) {
this.router.navigate(['/User', {uuid: user.publicUuid}]); this.router.navigate(['/User', user.publicUuid]);
} }
refresh() { refresh() {

View File

@ -63,7 +63,7 @@ export class GroupService {
} }
goto(group: Group) { goto(group: Group) {
this.router.navigate(['Group', {uuid: group.uuid}]); this.router.navigate(['Group', group.uuid]);
} }
} }

View File

@ -14,15 +14,12 @@ export const routes: Routes = [
{path: 'VoltageDrop', component: VoltageDropComponent}, {path: 'VoltageDrop', component: VoltageDropComponent},
{path: 'Groups', component: GroupsComponent}, {path: 'Groups', component: GroupsComponent},
{path: 'Group', component: GroupComponent}, {path: 'Group/:uuid', component: GroupComponent},
{path: 'User', component: UserComponent}, {path: 'User/:publicUuid', component: UserComponent},
{path: 'Profile', component: ProfileComponent}, {path: 'Profile', component: ProfileComponent},
// historic
{path: 'Solar', redirectTo: '/SolarSystem'},
// fallback // fallback
{path: '**', redirectTo: '/SolarSystem'}, {path: '**', redirectTo: '/SolarSystem'},
]; ];

View File

@ -29,9 +29,9 @@ export class UserComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.activatedRoute.params.subscribe(params => { this.activatedRoute.params.subscribe(params => {
const uuid = params['uuid']; const publicUuid = params['publicUuid'];
if (uuid) { if (publicUuid) {
this.userService.getCommonByUuid(uuid, user => this.user = user); this.userService.getCommonByUuid(publicUuid, user => this.user = user);
} }
}); });
} }