AllowNull,
BelongsTo,
Column,
- CreatedAt, DataType,
+ CreatedAt,
+ DataType,
ForeignKey,
Is,
Model,
Table,
UpdatedAt
} from 'sequelize-typescript'
-import { SortType } from '../../helpers/utils'
-import { getSortOnModel, throwIfNotValid } from '../utils'
+import { getSortOnModel, SortType, throwIfNotValid } from '../utils'
import { VideoModel } from './video'
import { isVideoBlacklistReasonValid } from '../../helpers/custom-validators/video-blacklist'
import { Emailer } from '../../lib/emailer'
-import { BlacklistedVideo } from '../../../shared/models/videos'
+import { VideoBlacklist } from '../../../shared/models/videos'
import { CONSTRAINTS_FIELDS } from '../../initializers'
@Table({
offset: start,
limit: count,
order: getSortOnModel(sort.sortModel, sort.sortValue),
- include: [ { model: VideoModel } ]
+ include: [
+ {
+ model: VideoModel,
+ required: true
+ }
+ ]
}
return VideoBlacklistModel.findAndCountAll(query)
return VideoBlacklistModel.findOne(query)
}
- toFormattedJSON (): BlacklistedVideo {
+ toFormattedJSON (): VideoBlacklist {
const video = this.Video
return {