aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/abuse/abuse.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-07-08 15:51:46 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-07-10 14:02:41 +0200
commit310b5219b38427f0c2c7ba57225afdd8f3064380 (patch)
tree853ff7e4e66425ca47b0999384eeb08ed14b28ff /server/models/abuse/abuse.ts
parent811cef146c841ef8530bc812c05dfee77e0f2998 (diff)
downloadPeerTube-310b5219b38427f0c2c7ba57225afdd8f3064380.tar.gz
PeerTube-310b5219b38427f0c2c7ba57225afdd8f3064380.tar.zst
PeerTube-310b5219b38427f0c2c7ba57225afdd8f3064380.zip
Add new abuses tests
Diffstat (limited to 'server/models/abuse/abuse.ts')
-rw-r--r--server/models/abuse/abuse.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/models/abuse/abuse.ts b/server/models/abuse/abuse.ts
index 28ecf8253..dffd503b3 100644
--- a/server/models/abuse/abuse.ts
+++ b/server/models/abuse/abuse.ts
@@ -362,8 +362,8 @@ export class AbuseModel extends Model<AbuseModel> {
362 const countReportsForReporter = this.get('countReportsForReporter') as number 362 const countReportsForReporter = this.get('countReportsForReporter') as number
363 const countReportsForReportee = this.get('countReportsForReportee') as number 363 const countReportsForReportee = this.get('countReportsForReportee') as number
364 364
365 let video: VideoAbuse 365 let video: VideoAbuse = null
366 let comment: VideoCommentAbuse 366 let comment: VideoCommentAbuse = null
367 367
368 if (this.VideoAbuse) { 368 if (this.VideoAbuse) {
369 const abuseModel = this.VideoAbuse 369 const abuseModel = this.VideoAbuse
@@ -391,13 +391,13 @@ export class AbuseModel extends Model<AbuseModel> {
391 391
392 if (this.VideoCommentAbuse) { 392 if (this.VideoCommentAbuse) {
393 const abuseModel = this.VideoCommentAbuse 393 const abuseModel = this.VideoCommentAbuse
394 const entity = abuseModel.VideoComment || abuseModel.deletedComment 394 const entity = abuseModel.VideoComment
395 395
396 comment = { 396 comment = {
397 id: entity.id, 397 id: entity.id,
398 text: entity.text, 398 text: entity.text ?? '',
399 399
400 deleted: !abuseModel.VideoComment, 400 deleted: entity.isDeleted(),
401 401
402 video: { 402 video: {
403 id: entity.Video.id, 403 id: entity.Video.id,