diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-31 10:41:44 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-31 10:41:44 +0100 |
commit | 61bbc7277501692d1520a421dff5af5d38ba6cf4 (patch) | |
tree | 4c705f7f42f70fc33f5233a4d79b6a6826482cc5 /client/src/app/shared/video-abuse | |
parent | 915c5bbe538769b1d3430b27817d6a861c766ef3 (diff) | |
download | PeerTube-61bbc7277501692d1520a421dff5af5d38ba6cf4.tar.gz PeerTube-61bbc7277501692d1520a421dff5af5d38ba6cf4.tar.zst PeerTube-61bbc7277501692d1520a421dff5af5d38ba6cf4.zip |
Fix human dates in result lists
Diffstat (limited to 'client/src/app/shared/video-abuse')
-rw-r--r-- | client/src/app/shared/video-abuse/video-abuse.service.ts | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/client/src/app/shared/video-abuse/video-abuse.service.ts b/client/src/app/shared/video-abuse/video-abuse.service.ts index 96a1f1fd2..ae00c4c45 100644 --- a/client/src/app/shared/video-abuse/video-abuse.service.ts +++ b/client/src/app/shared/video-abuse/video-abuse.service.ts | |||
@@ -5,9 +5,8 @@ import 'rxjs/add/operator/catch' | |||
5 | import 'rxjs/add/operator/map' | 5 | import 'rxjs/add/operator/map' |
6 | import { Observable } from 'rxjs/Observable' | 6 | import { Observable } from 'rxjs/Observable' |
7 | import { ResultList, VideoAbuse } from '../../../../../shared' | 7 | import { ResultList, VideoAbuse } from '../../../../../shared' |
8 | import { RestExtractor, RestPagination, RestService } from '../rest' | ||
9 | import { Utils } from '../utils' | ||
10 | import { environment } from '../../../environments/environment' | 8 | import { environment } from '../../../environments/environment' |
9 | import { RestExtractor, RestPagination, RestService } from '../rest' | ||
11 | 10 | ||
12 | @Injectable() | 11 | @Injectable() |
13 | export class VideoAbuseService { | 12 | export class VideoAbuseService { |
@@ -27,7 +26,6 @@ export class VideoAbuseService { | |||
27 | 26 | ||
28 | return this.authHttp.get<ResultList<VideoAbuse>>(url, { params }) | 27 | return this.authHttp.get<ResultList<VideoAbuse>>(url, { params }) |
29 | .map(res => this.restExtractor.convertResultListDateToHuman(res)) | 28 | .map(res => this.restExtractor.convertResultListDateToHuman(res)) |
30 | .map(res => this.restExtractor.applyToResultListData(res, this.formatVideoAbuse.bind(this))) | ||
31 | .catch(res => this.restExtractor.handleError(res)) | 29 | .catch(res => this.restExtractor.handleError(res)) |
32 | } | 30 | } |
33 | 31 | ||
@@ -41,11 +39,4 @@ export class VideoAbuseService { | |||
41 | .map(this.restExtractor.extractDataBool) | 39 | .map(this.restExtractor.extractDataBool) |
42 | .catch(res => this.restExtractor.handleError(res)) | 40 | .catch(res => this.restExtractor.handleError(res)) |
43 | } | 41 | } |
44 | |||
45 | private formatVideoAbuse (videoAbuse: VideoAbuse) { | ||
46 | return Object.assign(videoAbuse, { | ||
47 | createdAt: Utils.dateToHuman(videoAbuse.createdAt) | ||
48 | }) | ||
49 | } | ||
50 | |||
51 | } | 42 | } |