diff --git a/javascript/apps/taiga/src/app/modules/project/feature-shell/project-feature-shell-resolver.service.ts b/javascript/apps/taiga/src/app/modules/project/feature-shell/project-feature-shell-resolver.service.ts index 871dc2d00..551f9e4ac 100644 --- a/javascript/apps/taiga/src/app/modules/project/feature-shell/project-feature-shell-resolver.service.ts +++ b/javascript/apps/taiga/src/app/modules/project/feature-shell/project-feature-shell-resolver.service.ts @@ -8,7 +8,7 @@ import { HttpErrorResponse } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { ActivatedRouteSnapshot } from '@angular/router'; +import { ActivatedRouteSnapshot, Router } from '@angular/router'; import { ProjectApiService } from '@taiga/api'; import { of } from 'rxjs'; import { catchError } from 'rxjs/operators'; @@ -20,7 +20,8 @@ import { RevokeInvitationService } from '~/app/services/revoke-invitation.servic export class ProjectFeatureShellResolverService { constructor( private projectApiService: ProjectApiService, - private revokeInvitationService: RevokeInvitationService + private revokeInvitationService: RevokeInvitationService, + private router: Router ) {} public resolve(route: ActivatedRouteSnapshot) { @@ -30,6 +31,10 @@ export class ProjectFeatureShellResolverService { catchError((httpResponse: HttpErrorResponse) => { this.revokeInvitationService.shellResolverRevokeError(httpResponse); + if (httpResponse.status === 422) { + void this.router.navigate(['/not-found']); + } + return of(null); }) );