mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Removed the success filter from DSO data response so that all responses are returned, including 404.
This commit is contained in:
@@ -14,7 +14,7 @@ import { IdentifierType } from '../index/index.reducer';
|
||||
import { RemoteData } from './remote-data';
|
||||
import { DSOChangeAnalyzer } from './dso-change-analyzer.service';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { filter, tap } from 'rxjs/operators';
|
||||
import { filter, take, tap } from 'rxjs/operators';
|
||||
import { hasValue } from '../../shared/empty.util';
|
||||
import { getFinishedRemoteData } from '../shared/operators';
|
||||
import { Router } from '@angular/router';
|
||||
@@ -63,12 +63,14 @@ export class DsoRedirectDataService extends DataService<any> {
|
||||
this.setLinkPath(identifierType);
|
||||
return super.findById(id, identifierType).pipe(
|
||||
getFinishedRemoteData(),
|
||||
filter((response) => response.hasSucceeded),
|
||||
take(1),
|
||||
tap((response) => {
|
||||
const uuid = response.payload.uuid;
|
||||
const newRoute = this.getEndpointFromDSOType(response.payload.type);
|
||||
if (hasValue(uuid) && hasValue(newRoute)) {
|
||||
this.router.navigate([newRoute + '/' + uuid]);
|
||||
if (response.hasSucceeded) {
|
||||
const uuid = response.payload.uuid;
|
||||
const newRoute = this.getEndpointFromDSOType(response.payload.type);
|
||||
if (hasValue(uuid) && hasValue(newRoute)) {
|
||||
this.router.navigate([newRoute + '/' + uuid]);
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
|
Reference in New Issue
Block a user