blob: 1daf8e14e7fb81f4d45a1b8c97e576edae9fb73e [file] [log] [blame]
/********************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
import { ExternalPersonDetailsComponent } from '@pages/persons/external-person/external-person-details/external-person-details.component';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ExternalPersonResolver } from '@pages/persons/external-person/external-person.resolver';
import { Globals } from '@shared/constants/globals';
import { InternalPersonDetailsComponent } from '@pages/persons/internal-person/internal-person-details/internal-person-details.component';
import { InternalPersonResolver } from '@pages/persons/internal-person/internal-person.resolver';
const PATH = Globals.PATH;
const editPersonRoutes: Routes = [
{ path: PATH.EXTERNAL, redirectTo: `${PATH.EXTERNAL}/:contactId`, pathMatch: 'full' },
{ path: PATH.INTERNAL, redirectTo: `${PATH.INTERNAL}/:contactId`, pathMatch: 'full' },
{
path: `${PATH.EXTERNAL}/:contactId`,
component: ExternalPersonDetailsComponent,
resolve: {
externalPerson: ExternalPersonResolver,
},
},
{
path: `${PATH.INTERNAL}/:contactId`,
component: InternalPersonDetailsComponent,
resolve: {
internalPerson: InternalPersonResolver,
},
},
];
@NgModule({
imports: [RouterModule.forChild(editPersonRoutes)],
exports: [RouterModule],
})
export class PersonsRoutingModule {}