From 418cf7873a760bb19e48b1333910c27af794517b Mon Sep 17 00:00:00 2001 From: argirok Date: Mon, 13 Nov 2023 14:55:47 +0200 Subject: [PATCH] Researcher: navigate to error when there is no author --- src/app/app-routing.module.ts | 3 +++ src/app/researcher/researcher.component.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index fb9153b..826c5d2 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,6 +1,7 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import {Irish} from "./shared/irish"; +import {ErrorPageComponent} from "./openaireLibrary/error/errorPage.component"; const routes: Routes = [ { @@ -30,6 +31,8 @@ const routes: Routes = [ loadChildren: () => import('./admin/admin.module').then(m => m.AdminModule), data: {title: Irish.METADATA_PREFIX + ' Admin | '}, }, + {path: 'error', component: ErrorPageComponent}, + {path: '**', pathMatch: 'full', component: ErrorPageComponent} ]; @NgModule({ diff --git a/src/app/researcher/researcher.component.ts b/src/app/researcher/researcher.component.ts index a522d9b..47ba0a7 100644 --- a/src/app/researcher/researcher.component.ts +++ b/src/app/researcher/researcher.component.ts @@ -66,7 +66,6 @@ export class ResearcherComponent extends BaseComponent implements OnInit { if(this.authorId) { LinksResolver.resetProperties(); LinksResolver.setSearchAndResultLanding("researcher/"+this.authorId); - console.log(properties.searchLinkToPublication); this.subscriptions.push(this._searchOrcidService.searchOrcidSingleAuthor(this.authorId, properties, true).subscribe(data => { this.author = data; this._customFilterService.setCustomFilter( @@ -76,6 +75,8 @@ export class ResearcherComponent extends BaseComponent implements OnInit { // TODO not correct id/ no author // no irish author? + }, err => { + this._router.navigate([properties.errorLink]); })); } });