2020-10-01 15:21:22 +00:00
|
|
|
import { NgModule } from '@angular/core';
|
|
|
|
import { CommonModule } from '@angular/common';
|
|
|
|
import { RouterModule, Routes } from '@angular/router';
|
|
|
|
import { IssueResolver } from './issue-resolver.service';
|
|
|
|
import { AuthGuard } from '../auth/auth-guard.service';
|
|
|
|
import { IssueComponent } from './issue.component';
|
|
|
|
import { CostCentreListResolver } from '../cost-centre/cost-centre-list-resolver.service';
|
2018-05-25 13:49:00 +00:00
|
|
|
|
|
|
|
const issueRoutes: Routes = [
|
|
|
|
{
|
2019-06-12 14:04:50 +00:00
|
|
|
path: '',
|
2018-05-25 13:49:00 +00:00
|
|
|
component: IssueComponent,
|
|
|
|
canActivate: [AuthGuard],
|
|
|
|
data: {
|
2020-10-01 15:21:22 +00:00
|
|
|
permission: 'Issue',
|
2018-05-25 13:49:00 +00:00
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
voucher: IssueResolver,
|
2020-10-01 15:21:22 +00:00
|
|
|
costCentres: CostCentreListResolver,
|
2018-05-25 13:49:00 +00:00
|
|
|
},
|
2020-10-01 15:21:22 +00:00
|
|
|
runGuardsAndResolvers: 'always',
|
2018-05-25 13:49:00 +00:00
|
|
|
},
|
|
|
|
{
|
2019-06-12 14:04:50 +00:00
|
|
|
path: ':id',
|
2018-05-25 13:49:00 +00:00
|
|
|
component: IssueComponent,
|
|
|
|
canActivate: [AuthGuard],
|
|
|
|
data: {
|
2020-10-01 15:21:22 +00:00
|
|
|
permission: 'Issue',
|
2018-05-25 13:49:00 +00:00
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
voucher: IssueResolver,
|
2020-10-01 15:21:22 +00:00
|
|
|
costCentres: CostCentreListResolver,
|
2018-05-25 13:49:00 +00:00
|
|
|
},
|
2020-10-01 15:21:22 +00:00
|
|
|
runGuardsAndResolvers: 'always',
|
|
|
|
},
|
2018-05-25 13:49:00 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
@NgModule({
|
2020-10-01 15:21:22 +00:00
|
|
|
imports: [CommonModule, RouterModule.forChild(issueRoutes)],
|
|
|
|
exports: [RouterModule],
|
|
|
|
providers: [IssueResolver],
|
2018-05-25 13:49:00 +00:00
|
|
|
})
|
2020-10-01 15:21:22 +00:00
|
|
|
export class IssueRoutingModule {}
|