mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +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 { RemoteData } from './remote-data';
|
||||||
import { DSOChangeAnalyzer } from './dso-change-analyzer.service';
|
import { DSOChangeAnalyzer } from './dso-change-analyzer.service';
|
||||||
import { Injectable } from '@angular/core';
|
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 { hasValue } from '../../shared/empty.util';
|
||||||
import { getFinishedRemoteData } from '../shared/operators';
|
import { getFinishedRemoteData } from '../shared/operators';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
@@ -63,13 +63,15 @@ export class DsoRedirectDataService extends DataService<any> {
|
|||||||
this.setLinkPath(identifierType);
|
this.setLinkPath(identifierType);
|
||||||
return super.findById(id, identifierType).pipe(
|
return super.findById(id, identifierType).pipe(
|
||||||
getFinishedRemoteData(),
|
getFinishedRemoteData(),
|
||||||
filter((response) => response.hasSucceeded),
|
take(1),
|
||||||
tap((response) => {
|
tap((response) => {
|
||||||
|
if (response.hasSucceeded) {
|
||||||
const uuid = response.payload.uuid;
|
const uuid = response.payload.uuid;
|
||||||
const newRoute = this.getEndpointFromDSOType(response.payload.type);
|
const newRoute = this.getEndpointFromDSOType(response.payload.type);
|
||||||
if (hasValue(uuid) && hasValue(newRoute)) {
|
if (hasValue(uuid) && hasValue(newRoute)) {
|
||||||
this.router.navigate([newRoute + '/' + uuid]);
|
this.router.navigate([newRoute + '/' + uuid]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user