mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
added test and docs for 404 operator
This commit is contained in:
@@ -64,7 +64,12 @@ export const getSucceededRemoteData = () =>
|
||||
<T>(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
|
||||
source.pipe(find((rd: RemoteData<T>) => rd.hasSucceeded));
|
||||
|
||||
export const renderPageNotFoundOn404 = (router: Router) =>
|
||||
/**
|
||||
* Operator that checks if a remote data object contains a page not found error
|
||||
* When it does contain such an error, it will redirect the user to a page not found, without altering the current URL
|
||||
* @param router The router used to navigate to a new page
|
||||
*/
|
||||
export const redirectToPageNotFoundOn404 = (router: Router) =>
|
||||
<T>(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
|
||||
source.pipe(
|
||||
tap((rd: RemoteData<T>) => {
|
||||
|
Reference in New Issue
Block a user