Skip to content

Commit

Permalink
fix: redirect to the 404 page when project id is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfran committed Nov 23, 2023
1 parent 20fed26 commit b0f8cf2
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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) {
Expand All @@ -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);
})
);
Expand Down

0 comments on commit b0f8cf2

Please sign in to comment.