diff options
Diffstat (limited to 'client/src/app/+stats/video/video-stats.service.ts')
-rw-r--r-- | client/src/app/+stats/video/video-stats.service.ts | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/client/src/app/+stats/video/video-stats.service.ts b/client/src/app/+stats/video/video-stats.service.ts index 712d03971..e019c87f7 100644 --- a/client/src/app/+stats/video/video-stats.service.ts +++ b/client/src/app/+stats/video/video-stats.service.ts | |||
@@ -17,8 +17,18 @@ export class VideoStatsService { | |||
17 | private restExtractor: RestExtractor | 17 | private restExtractor: RestExtractor |
18 | ) { } | 18 | ) { } |
19 | 19 | ||
20 | getOverallStats (videoId: string) { | 20 | getOverallStats (options: { |
21 | return this.authHttp.get<VideoStatsOverall>(VideoService.BASE_VIDEO_URL + '/' + videoId + '/stats/overall') | 21 | videoId: string |
22 | startDate?: Date | ||
23 | endDate?: Date | ||
24 | }) { | ||
25 | const { videoId, startDate, endDate } = options | ||
26 | |||
27 | let params = new HttpParams() | ||
28 | if (startDate) params = params.append('startDate', startDate.toISOString()) | ||
29 | if (endDate) params = params.append('endDate', endDate.toISOString()) | ||
30 | |||
31 | return this.authHttp.get<VideoStatsOverall>(VideoService.BASE_VIDEO_URL + '/' + videoId + '/stats/overall', { params }) | ||
22 | .pipe(catchError(err => this.restExtractor.handleError(err))) | 32 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
23 | } | 33 | } |
24 | 34 | ||