From d3a84c7e7f5f31af42f0bdbb6bbfb96bfbfe33df Mon Sep 17 00:00:00 2001 From: Michael W Spalti Date: Wed, 30 Oct 2019 09:23:50 -0700 Subject: [PATCH] Updated matcher in lookup-by-id routing module. Converted id to const. --- .../+lookup-by-id/lookup-by-id-routing.module.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/app/+lookup-by-id/lookup-by-id-routing.module.ts b/src/app/+lookup-by-id/lookup-by-id-routing.module.ts index 758287bcbc..5ad3c2fd82 100644 --- a/src/app/+lookup-by-id/lookup-by-id-routing.module.ts +++ b/src/app/+lookup-by-id/lookup-by-id-routing.module.ts @@ -2,7 +2,7 @@ import { LookupGuard } from './lookup-guard'; import { NgModule } from '@angular/core'; import { RouterModule, UrlSegment } from '@angular/router'; import { ObjectNotFoundComponent } from './objectnotfound/objectnotfound.component'; -import { hasValue } from '../shared/empty.util'; +import { hasValue, isNotEmpty } from '../shared/empty.util'; @NgModule({ imports: [ @@ -11,14 +11,12 @@ import { hasValue } from '../shared/empty.util'; matcher: (url) => { // The expected path is :idType/:id const idType = url[0].path; - let id; // Allow for handles that are delimited with a forward slash. - if (url.length === 3) { - id = url[1].path + '/' + url[2].path; - } else { - id = url[1].path; - } - if (hasValue(idType) && hasValue(id)) { + const id = url + .slice(1) + .map((us: UrlSegment) => us.path) + .join('/'); + if (isNotEmpty(idType) && isNotEmpty(id)) { return { consumed: url, posParams: {