From b49f22d8f9a52ab75fd38db2d377249eb58fa678 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 8 Dec 2020 14:30:29 +0100 Subject: Upgrade sequelize to v6 --- server/models/video/video-blacklist.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'server/models/video/video-blacklist.ts') diff --git a/server/models/video/video-blacklist.ts b/server/models/video/video-blacklist.ts index 36d2a30fa..aa18896da 100644 --- a/server/models/video/video-blacklist.ts +++ b/server/models/video/video-blacklist.ts @@ -1,14 +1,13 @@ +import { FindOptions } from 'sequelize' import { AllowNull, BelongsTo, Column, CreatedAt, DataType, Default, ForeignKey, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' -import { getBlacklistSort, SortType, throwIfNotValid, searchAttribute } from '../utils' -import { VideoModel } from './video' -import { ScopeNames as VideoChannelScopeNames, SummaryOptions, VideoChannelModel } from './video-channel' -import { isVideoBlacklistReasonValid, isVideoBlacklistTypeValid } from '../../helpers/custom-validators/video-blacklist' +import { MVideoBlacklist, MVideoBlacklistFormattable } from '@server/types/models' import { VideoBlacklist, VideoBlacklistType } from '../../../shared/models/videos' +import { isVideoBlacklistReasonValid, isVideoBlacklistTypeValid } from '../../helpers/custom-validators/video-blacklist' import { CONSTRAINTS_FIELDS } from '../../initializers/constants' -import { FindOptions } from 'sequelize' +import { getBlacklistSort, searchAttribute, SortType, throwIfNotValid } from '../utils' import { ThumbnailModel } from './thumbnail' -import * as Bluebird from 'bluebird' -import { MVideoBlacklist, MVideoBlacklistFormattable } from '@server/types/models' +import { VideoModel } from './video' +import { ScopeNames as VideoChannelScopeNames, SummaryOptions, VideoChannelModel } from './video-channel' @Table({ tableName: 'videoBlacklist', @@ -19,7 +18,7 @@ import { MVideoBlacklist, MVideoBlacklistFormattable } from '@server/types/model } ] }) -export class VideoBlacklistModel extends Model { +export class VideoBlacklistModel extends Model { @AllowNull(true) @Is('VideoBlacklistReason', value => throwIfNotValid(value, isVideoBlacklistReasonValid, 'reason', true)) @@ -109,7 +108,7 @@ export class VideoBlacklistModel extends Model { }) } - static loadByVideoId (id: number): Bluebird { + static loadByVideoId (id: number): Promise { const query = { where: { videoId: id -- cgit v1.2.3