]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/core/rest/rest-extractor.service.ts
redirect to login on 401, display error variants in 404 component
[github/Chocobozzz/PeerTube.git] / client / src / app / core / rest / rest-extractor.service.ts
index 84d9ed074d4580b1348b6b2a262f6a9dba9af6cb..b8a95cca63d1a6e22c9c4f965ab3a3c8e8618f67 100644 (file)
@@ -93,10 +93,10 @@ export class RestExtractor {
     return observableThrowError(errorObj)
   }
 
-  redirectTo404IfNotFound (obj: { status: number }, status = [ HttpStatusCode.NOT_FOUND_404 ]) {
+  redirectTo404IfNotFound (obj: { status: number }, type: 'video' | 'other', status = [ HttpStatusCode.NOT_FOUND_404 ]) {
     if (obj && obj.status && status.indexOf(obj.status) !== -1) {
       // Do not use redirectService to avoid circular dependencies
-      this.router.navigate([ '/404' ], { skipLocationChange: true })
+      this.router.navigate([ '/404' ], { state: { type, obj }, skipLocationChange: true })
     }
 
     return observableThrowError(obj)