aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
Diffstat (limited to 'server/models')
-rw-r--r--server/models/abuse/abuse.ts36
1 files changed, 2 insertions, 34 deletions
diff --git a/server/models/abuse/abuse.ts b/server/models/abuse/abuse.ts
index 2a407c3d2..290270fe2 100644
--- a/server/models/abuse/abuse.ts
+++ b/server/models/abuse/abuse.ts
@@ -1,6 +1,6 @@
1import * as Bluebird from 'bluebird' 1import * as Bluebird from 'bluebird'
2import { invert } from 'lodash' 2import { invert } from 'lodash'
3import { literal, Op, QueryTypes, WhereOptions } from 'sequelize' 3import { literal, Op, QueryTypes } from 'sequelize'
4import { 4import {
5 AllowNull, 5 AllowNull,
6 BelongsTo, 6 BelongsTo,
@@ -265,32 +265,6 @@ export class AbuseModel extends Model<AbuseModel> {
265 }) 265 })
266 VideoAbuse: VideoAbuseModel 266 VideoAbuse: VideoAbuseModel
267 267
268 // FIXME: deprecated in 2.3. Remove these validators
269 static loadByIdAndVideoId (id: number, videoId?: number, uuid?: string): Bluebird<MAbuseReporter> {
270 const videoWhere: WhereOptions = {}
271
272 if (videoId) videoWhere.videoId = videoId
273 if (uuid) videoWhere.deletedVideo = { uuid }
274
275 const query = {
276 include: [
277 {
278 model: VideoAbuseModel,
279 required: true,
280 where: videoWhere
281 },
282 {
283 model: AccountModel,
284 as: 'ReporterAccount'
285 }
286 ],
287 where: {
288 id
289 }
290 }
291 return AbuseModel.findOne(query)
292 }
293
294 static loadByIdWithReporter (id: number): Bluebird<MAbuseReporter> { 268 static loadByIdWithReporter (id: number): Bluebird<MAbuseReporter> {
295 const query = { 269 const query = {
296 where: { 270 where: {
@@ -561,13 +535,7 @@ export class AbuseModel extends Model<AbuseModel> {
561 : null, 535 : null,
562 536
563 countReportsForReporter: (countReportsForReporter || 0), 537 countReportsForReporter: (countReportsForReporter || 0),
564 countReportsForReportee: (countReportsForReportee || 0), 538 countReportsForReportee: (countReportsForReportee || 0)
565
566 // FIXME: deprecated in 2.3, remove this
567 startAt: null,
568 endAt: null,
569 count: countReportsForVideo || 0,
570 nth: nthReportForVideo || 0
571 }) 539 })
572 } 540 }
573 541