Researcher: navigate to error when there is no author

This commit is contained in:
argirok 2023-11-13 14:55:47 +02:00
parent cff2dc8048
commit 418cf7873a
2 changed files with 5 additions and 1 deletions

View File

@ -1,6 +1,7 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import {Irish} from "./shared/irish"; import {Irish} from "./shared/irish";
import {ErrorPageComponent} from "./openaireLibrary/error/errorPage.component";
const routes: Routes = [ const routes: Routes = [
{ {
@ -30,6 +31,8 @@ const routes: Routes = [
loadChildren: () => import('./admin/admin.module').then(m => m.AdminModule), loadChildren: () => import('./admin/admin.module').then(m => m.AdminModule),
data: {title: Irish.METADATA_PREFIX + ' Admin | '}, data: {title: Irish.METADATA_PREFIX + ' Admin | '},
}, },
{path: 'error', component: ErrorPageComponent},
{path: '**', pathMatch: 'full', component: ErrorPageComponent}
]; ];
@NgModule({ @NgModule({

View File

@ -66,7 +66,6 @@ export class ResearcherComponent extends BaseComponent implements OnInit {
if(this.authorId) { if(this.authorId) {
LinksResolver.resetProperties(); LinksResolver.resetProperties();
LinksResolver.setSearchAndResultLanding("researcher/"+this.authorId); LinksResolver.setSearchAndResultLanding("researcher/"+this.authorId);
console.log(properties.searchLinkToPublication);
this.subscriptions.push(this._searchOrcidService.searchOrcidSingleAuthor(this.authorId, properties, true).subscribe(data => { this.subscriptions.push(this._searchOrcidService.searchOrcidSingleAuthor(this.authorId, properties, true).subscribe(data => {
this.author = data; this.author = data;
this._customFilterService.setCustomFilter( this._customFilterService.setCustomFilter(
@ -76,6 +75,8 @@ export class ResearcherComponent extends BaseComponent implements OnInit {
// TODO not correct id/ no author // no irish author? // TODO not correct id/ no author // no irish author?
}, err => {
this._router.navigate([properties.errorLink]);
})); }));
} }
}); });