]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix broken dates with localized pages
authorChocobozzz <me@florianbigard.com>
Fri, 16 Sep 2022 08:33:26 +0000 (10:33 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 16 Sep 2022 08:33:55 +0000 (10:33 +0200)
client/src/app/shared/shared-instance/instance-follow.service.ts
client/src/app/shared/shared-main/users/user-notification.service.ts
client/src/app/shared/shared-main/video/video-import.service.ts
client/src/app/shared/shared-main/video/video-ownership.service.ts
client/src/app/shared/shared-moderation/blocklist.service.ts
client/src/app/shared/shared-moderation/video-block.service.ts

index 5366fd06837bfe6600f706cdaf336921edb5249e..7568fbbf445327239d693c219f5591464a0ca784 100644 (file)
@@ -1,6 +1,6 @@
 import { SortMeta } from 'primeng/api'
 import { from, Observable } from 'rxjs'
-import { catchError, concatMap, map, toArray } from 'rxjs/operators'
+import { catchError, concatMap, toArray } from 'rxjs/operators'
 import { HttpClient, HttpParams } from '@angular/common/http'
 import { Injectable } from '@angular/core'
 import { RestExtractor, RestPagination, RestService } from '@app/core'
@@ -40,10 +40,7 @@ export class InstanceFollowService {
     if (actorType) params = params.append('actorType', actorType)
 
     return this.authHttp.get<ResultList<ActorFollow>>(InstanceFollowService.BASE_APPLICATION_URL + '/following', { params })
-               .pipe(
-                 map(res => this.restExtractor.convertResultListDateToHuman(res)),
-                 catchError(res => this.restExtractor.handleError(res))
-               )
+               .pipe(catchError(res => this.restExtractor.handleError(res)))
   }
 
   getFollowers (options: {
@@ -66,10 +63,7 @@ export class InstanceFollowService {
     if (actorType) params = params.append('actorType', actorType)
 
     return this.authHttp.get<ResultList<ActorFollow>>(InstanceFollowService.BASE_APPLICATION_URL + '/followers', { params })
-               .pipe(
-                 map(res => this.restExtractor.convertResultListDateToHuman(res)),
-                 catchError(res => this.restExtractor.handleError(res))
-               )
+               .pipe(catchError(res => this.restExtractor.handleError(res)))
   }
 
   follow (hostsOrHandles: string[]) {
index df886ed653dfdcf656449b21736f67c898ae63f7..0b3dd9a53824e63ca513d3125070c4558debc52d 100644 (file)
@@ -40,7 +40,6 @@ export class UserNotificationService {
 
     return this.authHttp.get<ResultList<UserNotification>>(UserNotificationService.BASE_NOTIFICATIONS_URL, { params, context })
                .pipe(
-                 map(res => this.restExtractor.convertResultListDateToHuman(res)),
                  map(res => this.restExtractor.applyToResultListData(res, this.formatNotification.bind(this))),
                  catchError(err => this.restExtractor.handleError(err))
                )
index f9720033a0bf16642b88526f19b54da589198f05..607c08d7142e30f8d406cddfff0c8573947b540a 100644 (file)
@@ -64,7 +64,6 @@ export class VideoImportService {
                .get<ResultList<VideoImport>>(UserService.BASE_USERS_URL + '/me/videos/imports', { params })
                .pipe(
                  switchMap(res => this.extractVideoImports(res)),
-                 map(res => this.restExtractor.convertResultListDateToHuman(res)),
                  catchError(err => this.restExtractor.handleError(err))
                )
   }
index bc0e1b1d10ca5fc4367a6fa27ba0cda75176de79..1e8f7f68cc9f40248aee55d9d541075754700d74 100644 (file)
@@ -1,6 +1,6 @@
 import { SortMeta } from 'primeng/api'
 import { Observable } from 'rxjs'
-import { catchError, map } from 'rxjs/operators'
+import { catchError } from 'rxjs/operators'
 import { HttpClient, HttpParams } from '@angular/common/http'
 import { Injectable } from '@angular/core'
 import { RestExtractor, RestPagination, RestService } from '@app/core'
@@ -35,10 +35,7 @@ export class VideoOwnershipService {
     params = this.restService.addRestGetParams(params, pagination, sort)
 
     return this.authHttp.get<ResultList<VideoChangeOwnership>>(url, { params })
-      .pipe(
-        map(res => this.restExtractor.convertResultListDateToHuman(res)),
-        catchError(res => this.restExtractor.handleError(res))
-      )
+      .pipe(catchError(res => this.restExtractor.handleError(res)))
   }
 
   acceptOwnership (id: number, input: VideoChangeOwnershipAccept) {
index 1169bf75780a58c3e9c69afb4b2fdeab68dda520..0fb7536e57266b4ebb2a18df2566caae439ccc88 100644 (file)
@@ -53,7 +53,6 @@ export class BlocklistService {
 
     return this.authHttp.get<ResultList<AccountBlock>>(BlocklistService.BASE_USER_BLOCKLIST_URL + '/accounts', { params })
                .pipe(
-                 map(res => this.restExtractor.convertResultListDateToHuman(res)),
                  map(res => this.restExtractor.applyToResultListData(res, this.formatAccountBlock.bind(this))),
                  catchError(err => this.restExtractor.handleError(err))
                )
@@ -84,10 +83,7 @@ export class BlocklistService {
     if (search) params = params.append('search', search)
 
     return this.authHttp.get<ResultList<ServerBlock>>(BlocklistService.BASE_USER_BLOCKLIST_URL + '/servers', { params })
-               .pipe(
-                 map(res => this.restExtractor.convertResultListDateToHuman(res)),
-                 catchError(err => this.restExtractor.handleError(err))
-               )
+               .pipe(catchError(err => this.restExtractor.handleError(err)))
   }
 
   blockServerByUser (host: string) {
@@ -116,7 +112,6 @@ export class BlocklistService {
 
     return this.authHttp.get<ResultList<AccountBlock>>(BlocklistService.BASE_SERVER_BLOCKLIST_URL + '/accounts', { params })
                .pipe(
-                 map(res => this.restExtractor.convertResultListDateToHuman(res)),
                  map(res => this.restExtractor.applyToResultListData(res, this.formatAccountBlock.bind(this))),
                  catchError(err => this.restExtractor.handleError(err))
                )
@@ -151,10 +146,7 @@ export class BlocklistService {
     if (search) params = params.append('search', search)
 
     return this.authHttp.get<ResultList<ServerBlock>>(BlocklistService.BASE_SERVER_BLOCKLIST_URL + '/servers', { params })
-               .pipe(
-                 map(res => this.restExtractor.convertResultListDateToHuman(res)),
-                 catchError(err => this.restExtractor.handleError(err))
-               )
+               .pipe(catchError(err => this.restExtractor.handleError(err)))
   }
 
   blockServerByInstance (host: string) {
index 6272b672fdede24890d9a85c65ea85f415fd8921..ab352a2d64ea4c92d68bc2d2c3ea24381dcbe7ed 100644 (file)
@@ -1,6 +1,6 @@
 import { SortMeta } from 'primeng/api'
 import { from as observableFrom, Observable } from 'rxjs'
-import { catchError, concatMap, map, toArray } from 'rxjs/operators'
+import { catchError, concatMap, toArray } from 'rxjs/operators'
 import { HttpClient, HttpParams } from '@angular/common/http'
 import { Injectable } from '@angular/core'
 import { RestExtractor, RestPagination, RestService } from '@app/core'
@@ -47,10 +47,7 @@ export class VideoBlockService {
     if (type) params = params.append('type', type.toString())
 
     return this.authHttp.get<ResultList<VideoBlacklist>>(VideoBlockService.BASE_VIDEOS_URL + 'blacklist', { params })
-               .pipe(
-                 map(res => this.restExtractor.convertResultListDateToHuman(res)),
-                 catchError(res => this.restExtractor.handleError(res))
-               )
+               .pipe(catchError(res => this.restExtractor.handleError(res)))
   }
 
   unblockVideo (videoIdArgs: number | number[]) {