From 0db536f1e00e2f0c019b5ea3807f1d9125ff4f1d Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Sun, 3 May 2020 16:23:09 +0200 Subject: [PATCH] Only show updatedAt date of abuse if different from createdAt --- .../moderation/video-abuse-list/video-abuse-list.component.ts | 1 + client/src/app/shared/video-abuse/video-abuse.service.ts | 1 - shared/models/videos/abuse/video-abuse.model.ts | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts index e87163c4f..83d194d52 100644 --- a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts +++ b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts @@ -289,6 +289,7 @@ export class VideoAbuseListComponent extends RestTable implements OnInit, AfterV embedHtml: this.sanitizer.bypassSecurityTrustHtml(this.getVideoEmbed(abuse)), reporterAccount: new Account(abuse.reporterAccount) }) + if (abuse.updatedAt === abuse.createdAt) delete abuse.updatedAt } }, 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 a39ad31d4..1ab6b5376 100644 --- a/client/src/app/shared/video-abuse/video-abuse.service.ts +++ b/client/src/app/shared/video-abuse/video-abuse.service.ts @@ -32,7 +32,6 @@ export class VideoAbuseService { return this.authHttp.get>(url, { params }) .pipe( - map(res => this.restExtractor.convertResultListDateToHuman(res)), catchError(res => this.restExtractor.handleError(res)) ) } diff --git a/shared/models/videos/abuse/video-abuse.model.ts b/shared/models/videos/abuse/video-abuse.model.ts index f2c2cdc41..bbef7f4f9 100644 --- a/shared/models/videos/abuse/video-abuse.model.ts +++ b/shared/models/videos/abuse/video-abuse.model.ts @@ -23,7 +23,7 @@ export interface VideoAbuse { } createdAt: Date - updatedAt: Date + updatedAt?: Date count?: number nth?: number -- 2.25.1