From 453e83ea5d81d203ba34bc43cd5c2c750ba40568 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 15 Aug 2019 11:53:26 +0200 Subject: Stronger model typings --- server/lib/video-blacklist.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'server/lib/video-blacklist.ts') diff --git a/server/lib/video-blacklist.ts b/server/lib/video-blacklist.ts index bdaecd8e2..a0fc26e84 100644 --- a/server/lib/video-blacklist.ts +++ b/server/lib/video-blacklist.ts @@ -2,16 +2,15 @@ import { Transaction } from 'sequelize' import { CONFIG } from '../initializers/config' import { UserRight, VideoBlacklistType } from '../../shared/models' import { VideoBlacklistModel } from '../models/video/video-blacklist' -import { UserModel } from '../models/account/user' -import { VideoModel } from '../models/video/video' import { logger } from '../helpers/logger' import { UserAdminFlag } from '../../shared/models/users/user-flag.model' import { Hooks } from './plugins/hooks' import { Notifier } from './notifier' +import { MUser, MVideoBlacklist, MVideoWithBlacklistLight } from '@server/typings/models' async function autoBlacklistVideoIfNeeded (parameters: { - video: VideoModel, - user?: UserModel, + video: MVideoWithBlacklistLight, + user?: MUser, isRemote: boolean, isNew: boolean, notify?: boolean, @@ -32,7 +31,7 @@ async function autoBlacklistVideoIfNeeded (parameters: { reason: 'Auto-blacklisted. Moderator review required.', type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED } - const [ videoBlacklist ] = await VideoBlacklistModel.findOrCreate({ + const [ videoBlacklist ] = await VideoBlacklistModel.findOrCreate({ where: { videoId: video.id }, @@ -49,10 +48,10 @@ async function autoBlacklistVideoIfNeeded (parameters: { } async function autoBlacklistNeeded (parameters: { - video: VideoModel, + video: MVideoWithBlacklistLight, isRemote: boolean, isNew: boolean, - user?: UserModel + user?: MUser }) { const { user, video, isRemote, isNew } = parameters -- cgit v1.2.3