aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/+admin/admin-routing.module.ts
blob: 0cd3e54c27c98a1361c67660fafbba7e54171deb (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                                                      
 

                                          

                                                  
                                                              

                                                  
                                                  
                                             
 
                             
   
             
                              

                                                
               




                            
                       
                                 
                     

                           

     
 





                                                  
import { NgModule } from '@angular/core'
import { RouterModule, Routes } from '@angular/router'

import { MetaGuard } from '@ngx-meta/core'

import { AdminComponent } from './admin.component'
import { FriendsRoutes } from './friends'
import { RequestSchedulersRoutes } from './request-schedulers'
import { UsersRoutes } from './users'
import { VideoAbusesRoutes } from './video-abuses'
import { AdminGuard } from './admin-guard.service'
import { BlacklistRoutes } from './blacklist'

const adminRoutes: Routes = [
  {
    path: '',
    component: AdminComponent,
    canActivate: [ MetaGuard, AdminGuard ],
    canActivateChild: [ MetaGuard, AdminGuard ],
    children: [
      {
        path: '',
        redirectTo: 'users',
        pathMatch: 'full'
      },
      ...FriendsRoutes,
      ...RequestSchedulersRoutes,
      ...UsersRoutes,
      ...VideoAbusesRoutes,
      ...BlacklistRoutes
    ]
  }
]

@NgModule({
  imports: [ RouterModule.forChild(adminRoutes) ],
  exports: [ RouterModule ]
})
export class AdminRoutingModule {}