speaking routes
This commit is contained in:
parent
14f1358528
commit
63231e0181
@ -49,7 +49,7 @@ export class UserService {
|
||||
}
|
||||
|
||||
goto(user: UserPublic) {
|
||||
this.router.navigate(['/User', {uuid: user.publicUuid}]);
|
||||
this.router.navigate(['/User', user.publicUuid]);
|
||||
}
|
||||
|
||||
refresh() {
|
||||
|
||||
@ -63,7 +63,7 @@ export class GroupService {
|
||||
}
|
||||
|
||||
goto(group: Group) {
|
||||
this.router.navigate(['Group', {uuid: group.uuid}]);
|
||||
this.router.navigate(['Group', group.uuid]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -14,15 +14,12 @@ export const routes: Routes = [
|
||||
{path: 'VoltageDrop', component: VoltageDropComponent},
|
||||
|
||||
{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},
|
||||
|
||||
// historic
|
||||
{path: 'Solar', redirectTo: '/SolarSystem'},
|
||||
|
||||
// fallback
|
||||
{path: '**', redirectTo: '/SolarSystem'},
|
||||
];
|
||||
|
||||
@ -29,9 +29,9 @@ export class UserComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
this.activatedRoute.params.subscribe(params => {
|
||||
const uuid = params['uuid'];
|
||||
if (uuid) {
|
||||
this.userService.getCommonByUuid(uuid, user => this.user = user);
|
||||
const publicUuid = params['publicUuid'];
|
||||
if (publicUuid) {
|
||||
this.userService.getCommonByUuid(publicUuid, user => this.user = user);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user