speaking routes
This commit is contained in:
parent
14f1358528
commit
63231e0181
@ -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() {
|
||||||
|
|||||||
@ -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]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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'},
|
||||||
];
|
];
|
||||||
|
|||||||
@ -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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user