aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-moderation
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-09-16 10:33:26 +0200
committerChocobozzz <me@florianbigard.com>2022-09-16 10:33:55 +0200
commit3afe0ec3b32d2bd9183541ecbf40278710f8707d (patch)
treeb2abcc754dfa9a3b22d8a56c89902da801265b86 /client/src/app/shared/shared-moderation
parent56162c6a06732b6beb2021d0d95450363e21cadf (diff)
downloadPeerTube-3afe0ec3b32d2bd9183541ecbf40278710f8707d.tar.gz
PeerTube-3afe0ec3b32d2bd9183541ecbf40278710f8707d.tar.zst
PeerTube-3afe0ec3b32d2bd9183541ecbf40278710f8707d.zip
Fix broken dates with localized pages
Diffstat (limited to 'client/src/app/shared/shared-moderation')
-rw-r--r--client/src/app/shared/shared-moderation/blocklist.service.ts12
-rw-r--r--client/src/app/shared/shared-moderation/video-block.service.ts7
2 files changed, 4 insertions, 15 deletions
diff --git a/client/src/app/shared/shared-moderation/blocklist.service.ts b/client/src/app/shared/shared-moderation/blocklist.service.ts
index 1169bf757..0fb7536e5 100644
--- a/client/src/app/shared/shared-moderation/blocklist.service.ts
+++ b/client/src/app/shared/shared-moderation/blocklist.service.ts
@@ -53,7 +53,6 @@ export class BlocklistService {
53 53
54 return this.authHttp.get<ResultList<AccountBlock>>(BlocklistService.BASE_USER_BLOCKLIST_URL + '/accounts', { params }) 54 return this.authHttp.get<ResultList<AccountBlock>>(BlocklistService.BASE_USER_BLOCKLIST_URL + '/accounts', { params })
55 .pipe( 55 .pipe(
56 map(res => this.restExtractor.convertResultListDateToHuman(res)),
57 map(res => this.restExtractor.applyToResultListData(res, this.formatAccountBlock.bind(this))), 56 map(res => this.restExtractor.applyToResultListData(res, this.formatAccountBlock.bind(this))),
58 catchError(err => this.restExtractor.handleError(err)) 57 catchError(err => this.restExtractor.handleError(err))
59 ) 58 )
@@ -84,10 +83,7 @@ export class BlocklistService {
84 if (search) params = params.append('search', search) 83 if (search) params = params.append('search', search)
85 84
86 return this.authHttp.get<ResultList<ServerBlock>>(BlocklistService.BASE_USER_BLOCKLIST_URL + '/servers', { params }) 85 return this.authHttp.get<ResultList<ServerBlock>>(BlocklistService.BASE_USER_BLOCKLIST_URL + '/servers', { params })
87 .pipe( 86 .pipe(catchError(err => this.restExtractor.handleError(err)))
88 map(res => this.restExtractor.convertResultListDateToHuman(res)),
89 catchError(err => this.restExtractor.handleError(err))
90 )
91 } 87 }
92 88
93 blockServerByUser (host: string) { 89 blockServerByUser (host: string) {
@@ -116,7 +112,6 @@ export class BlocklistService {
116 112
117 return this.authHttp.get<ResultList<AccountBlock>>(BlocklistService.BASE_SERVER_BLOCKLIST_URL + '/accounts', { params }) 113 return this.authHttp.get<ResultList<AccountBlock>>(BlocklistService.BASE_SERVER_BLOCKLIST_URL + '/accounts', { params })
118 .pipe( 114 .pipe(
119 map(res => this.restExtractor.convertResultListDateToHuman(res)),
120 map(res => this.restExtractor.applyToResultListData(res, this.formatAccountBlock.bind(this))), 115 map(res => this.restExtractor.applyToResultListData(res, this.formatAccountBlock.bind(this))),
121 catchError(err => this.restExtractor.handleError(err)) 116 catchError(err => this.restExtractor.handleError(err))
122 ) 117 )
@@ -151,10 +146,7 @@ export class BlocklistService {
151 if (search) params = params.append('search', search) 146 if (search) params = params.append('search', search)
152 147
153 return this.authHttp.get<ResultList<ServerBlock>>(BlocklistService.BASE_SERVER_BLOCKLIST_URL + '/servers', { params }) 148 return this.authHttp.get<ResultList<ServerBlock>>(BlocklistService.BASE_SERVER_BLOCKLIST_URL + '/servers', { params })
154 .pipe( 149 .pipe(catchError(err => this.restExtractor.handleError(err)))
155 map(res => this.restExtractor.convertResultListDateToHuman(res)),
156 catchError(err => this.restExtractor.handleError(err))
157 )
158 } 150 }
159 151
160 blockServerByInstance (host: string) { 152 blockServerByInstance (host: string) {
diff --git a/client/src/app/shared/shared-moderation/video-block.service.ts b/client/src/app/shared/shared-moderation/video-block.service.ts
index 6272b672f..ab352a2d6 100644
--- a/client/src/app/shared/shared-moderation/video-block.service.ts
+++ b/client/src/app/shared/shared-moderation/video-block.service.ts
@@ -1,6 +1,6 @@
1import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
2import { from as observableFrom, Observable } from 'rxjs' 2import { from as observableFrom, Observable } from 'rxjs'
3import { catchError, concatMap, map, toArray } from 'rxjs/operators' 3import { catchError, concatMap, toArray } from 'rxjs/operators'
4import { HttpClient, HttpParams } from '@angular/common/http' 4import { HttpClient, HttpParams } from '@angular/common/http'
5import { Injectable } from '@angular/core' 5import { Injectable } from '@angular/core'
6import { RestExtractor, RestPagination, RestService } from '@app/core' 6import { RestExtractor, RestPagination, RestService } from '@app/core'
@@ -47,10 +47,7 @@ export class VideoBlockService {
47 if (type) params = params.append('type', type.toString()) 47 if (type) params = params.append('type', type.toString())
48 48
49 return this.authHttp.get<ResultList<VideoBlacklist>>(VideoBlockService.BASE_VIDEOS_URL + 'blacklist', { params }) 49 return this.authHttp.get<ResultList<VideoBlacklist>>(VideoBlockService.BASE_VIDEOS_URL + 'blacklist', { params })
50 .pipe( 50 .pipe(catchError(res => this.restExtractor.handleError(res)))
51 map(res => this.restExtractor.convertResultListDateToHuman(res)),
52 catchError(res => this.restExtractor.handleError(res))
53 )
54 } 51 }
55 52
56 unblockVideo (videoIdArgs: number | number[]) { 53 unblockVideo (videoIdArgs: number | number[]) {