diff options
author | Chocobozzz <me@florianbigard.com> | 2022-07-15 15:30:14 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-07-18 11:37:18 +0200 |
commit | 42b40636991b97fe818007fab19091764fc5db73 (patch) | |
tree | db431787c06ce898d22e91ff771f795219274fc6 /client/src/app/+search | |
parent | 654d4ede7fa4d0faa71e49bcfab6b65a686397b2 (diff) | |
download | PeerTube-42b40636991b97fe818007fab19091764fc5db73.tar.gz PeerTube-42b40636991b97fe818007fab19091764fc5db73.tar.zst PeerTube-42b40636991b97fe818007fab19091764fc5db73.zip |
Add ability for client to create server logs
Diffstat (limited to 'client/src/app/+search')
-rw-r--r-- | client/src/app/+search/shared/abstract-lazy-load.resolver.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/client/src/app/+search/shared/abstract-lazy-load.resolver.ts b/client/src/app/+search/shared/abstract-lazy-load.resolver.ts index b18a5b64d..7551d977d 100644 --- a/client/src/app/+search/shared/abstract-lazy-load.resolver.ts +++ b/client/src/app/+search/shared/abstract-lazy-load.resolver.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { Observable } from 'rxjs' | 1 | import { Observable } from 'rxjs' |
2 | import { map } from 'rxjs/operators' | 2 | import { map } from 'rxjs/operators' |
3 | import { ActivatedRouteSnapshot, Resolve, Router } from '@angular/router' | 3 | import { ActivatedRouteSnapshot, Resolve, Router } from '@angular/router' |
4 | import { logger } from '@root-helpers/logger' | ||
4 | import { ResultList } from '@shared/models' | 5 | import { ResultList } from '@shared/models' |
5 | 6 | ||
6 | export abstract class AbstractLazyLoadResolver <T> implements Resolve<any> { | 7 | export abstract class AbstractLazyLoadResolver <T> implements Resolve<any> { |
@@ -10,7 +11,7 @@ export abstract class AbstractLazyLoadResolver <T> implements Resolve<any> { | |||
10 | const url = route.params.url | 11 | const url = route.params.url |
11 | 12 | ||
12 | if (!url) { | 13 | if (!url) { |
13 | console.error('Could not find url param.', { params: route.params }) | 14 | logger.error('Could not find url param.', { params: route.params }) |
14 | return this.router.navigateByUrl('/404') | 15 | return this.router.navigateByUrl('/404') |
15 | } | 16 | } |
16 | 17 | ||
@@ -18,7 +19,7 @@ export abstract class AbstractLazyLoadResolver <T> implements Resolve<any> { | |||
18 | .pipe( | 19 | .pipe( |
19 | map(result => { | 20 | map(result => { |
20 | if (result.data.length !== 1) { | 21 | if (result.data.length !== 1) { |
21 | console.error('Cannot find result for this URL') | 22 | logger.error('Cannot find result for this URL') |
22 | return this.router.navigateByUrl('/404') | 23 | return this.router.navigateByUrl('/404') |
23 | } | 24 | } |
24 | 25 | ||