]>
Commit | Line | Data |
---|---|---|
1 | import { NgModule } from '@angular/core' | |
2 | import { RouterModule, Routes } from '@angular/router' | |
3 | import { AccountVideoChannelsComponent } from './account-video-channels/account-video-channels.component' | |
4 | import { AccountVideosComponent } from './account-videos/account-videos.component' | |
5 | import { AccountsComponent } from './accounts.component' | |
6 | ||
7 | const accountsRoutes: Routes = [ | |
8 | { | |
9 | path: 'peertube', | |
10 | redirectTo: '/videos/local' | |
11 | }, | |
12 | { | |
13 | path: ':accountId', | |
14 | component: AccountsComponent, | |
15 | children: [ | |
16 | { | |
17 | path: '', | |
18 | redirectTo: 'video-channels', | |
19 | pathMatch: 'full' | |
20 | }, | |
21 | { | |
22 | path: 'video-channels', | |
23 | component: AccountVideoChannelsComponent, | |
24 | data: { | |
25 | meta: { | |
26 | title: $localize`Account video channels` | |
27 | } | |
28 | } | |
29 | }, | |
30 | { | |
31 | path: 'videos', | |
32 | component: AccountVideosComponent, | |
33 | data: { | |
34 | meta: { | |
35 | title: $localize`Account videos` | |
36 | }, | |
37 | reuse: { | |
38 | enabled: true, | |
39 | key: 'account-videos-list' | |
40 | } | |
41 | } | |
42 | }, | |
43 | ||
44 | // Old URL redirection | |
45 | { | |
46 | path: 'search', | |
47 | redirectTo: 'videos' | |
48 | } | |
49 | ] | |
50 | } | |
51 | ] | |
52 | ||
53 | @NgModule({ | |
54 | imports: [ RouterModule.forChild(accountsRoutes) ], | |
55 | exports: [ RouterModule ] | |
56 | }) | |
57 | export class AccountsRoutingModule {} |