diff --git a/src/app/features/preprints/services/preprints.service.ts b/src/app/features/preprints/services/preprints.service.ts index 0b037250a..d9edd0e91 100644 --- a/src/app/features/preprints/services/preprints.service.ts +++ b/src/app/features/preprints/services/preprints.service.ts @@ -100,7 +100,7 @@ export class PreprintsService { .pipe( map((response) => PreprintsMapper.fromPreprintWithEmbedsJsonApi(response)), catchError((error) => { - if (error.status === 410) { + if (error.error?.errors?.[0]?.meta?.flagged_content) { this.router.navigate(['/spam-content']); } return throwError(() => error); diff --git a/src/app/shared/services/resource.service.ts b/src/app/shared/services/resource.service.ts index 9255215d0..43dbb251a 100644 --- a/src/app/shared/services/resource.service.ts +++ b/src/app/shared/services/resource.service.ts @@ -63,7 +63,7 @@ export class ResourceGuidService { ), finalize(() => this.loaderService.hide()), catchError((error) => { - if (error.status === 410) { + if (error.error?.errors?.[0]?.meta?.flagged_content) { this.router.navigate(['/spam-content']); } return throwError(() => error);