diff options
Diffstat (limited to 'server/models/video/video-blacklist.ts')
-rw-r--r-- | server/models/video/video-blacklist.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/server/models/video/video-blacklist.ts b/server/models/video/video-blacklist.ts index 1b8a338cb..eabc37ef0 100644 --- a/server/models/video/video-blacklist.ts +++ b/server/models/video/video-blacklist.ts | |||
@@ -16,7 +16,7 @@ import { getSortOnModel, throwIfNotValid } from '../utils' | |||
16 | import { VideoModel } from './video' | 16 | import { VideoModel } from './video' |
17 | import { isVideoBlacklistReasonValid } from '../../helpers/custom-validators/video-blacklist' | 17 | import { isVideoBlacklistReasonValid } from '../../helpers/custom-validators/video-blacklist' |
18 | import { Emailer } from '../../lib/emailer' | 18 | import { Emailer } from '../../lib/emailer' |
19 | import { BlacklistedVideo } from '../../../shared/models/videos' | 19 | import { VideoBlacklist } from '../../../shared/models/videos' |
20 | import { CONSTRAINTS_FIELDS } from '../../initializers' | 20 | import { CONSTRAINTS_FIELDS } from '../../initializers' |
21 | 21 | ||
22 | @Table({ | 22 | @Table({ |
@@ -68,7 +68,12 @@ export class VideoBlacklistModel extends Model<VideoBlacklistModel> { | |||
68 | offset: start, | 68 | offset: start, |
69 | limit: count, | 69 | limit: count, |
70 | order: getSortOnModel(sort.sortModel, sort.sortValue), | 70 | order: getSortOnModel(sort.sortModel, sort.sortValue), |
71 | include: [ { model: VideoModel } ] | 71 | include: [ |
72 | { | ||
73 | model: VideoModel, | ||
74 | required: true | ||
75 | } | ||
76 | ] | ||
72 | } | 77 | } |
73 | 78 | ||
74 | return VideoBlacklistModel.findAndCountAll(query) | 79 | return VideoBlacklistModel.findAndCountAll(query) |
@@ -90,7 +95,7 @@ export class VideoBlacklistModel extends Model<VideoBlacklistModel> { | |||
90 | return VideoBlacklistModel.findOne(query) | 95 | return VideoBlacklistModel.findOne(query) |
91 | } | 96 | } |
92 | 97 | ||
93 | toFormattedJSON (): BlacklistedVideo { | 98 | toFormattedJSON (): VideoBlacklist { |
94 | const video = this.Video | 99 | const video = this.Video |
95 | 100 | ||
96 | return { | 101 | return { |