- // FIXME: deprecated in 2.3. Remove these validators
- static loadByIdAndVideoId (id: number, videoId?: number, uuid?: string): Bluebird<MAbuseReporter> {
- const videoWhere: WhereOptions = {}
-
- if (videoId) videoWhere.videoId = videoId
- if (uuid) videoWhere.deletedVideo = { uuid }
-
- const query = {
- include: [
- {
- model: VideoAbuseModel,
- required: true,
- where: videoWhere
- },
- {
- model: AccountModel,
- as: 'ReporterAccount'
- }
- ],
- where: {
- id
- }
- }
- return AbuseModel.findOne(query)
- }
-