videoAbuseUpdateValidator
} from '../../../middlewares'
import { AccountModel } from '../../../models/account/account'
-import { VideoModel } from '../../../models/video/video'
import { VideoAbuseModel } from '../../../models/video/video-abuse'
import { auditLoggerFactory, VideoAbuseAuditView } from '../../../helpers/audit-logger'
-import { UserModel } from '../../../models/account/user'
import { Notifier } from '../../../lib/notifier'
import { sendVideoAbuse } from '../../../lib/activitypub/send/send-flag'
}
async function updateVideoAbuse (req: express.Request, res: express.Response) {
- const videoAbuse: VideoAbuseModel = res.locals.videoAbuse
+ const videoAbuse = res.locals.videoAbuse
if (req.body.moderationComment !== undefined) videoAbuse.moderationComment = req.body.moderationComment
if (req.body.state !== undefined) videoAbuse.state = req.body.state
}
async function deleteVideoAbuse (req: express.Request, res: express.Response) {
- const videoAbuse: VideoAbuseModel = res.locals.videoAbuse
+ const videoAbuse = res.locals.videoAbuse
await sequelizeTypescript.transaction(t => {
return videoAbuse.destroy({ transaction: t })
}
async function reportVideoAbuse (req: express.Request, res: express.Response) {
- const videoInstance = res.locals.video as VideoModel
+ const videoInstance = res.locals.video
const body: VideoAbuseCreate = req.body
const videoAbuse: VideoAbuseModel = await sequelizeTypescript.transaction(async t => {
- const reporterAccount = await AccountModel.load((res.locals.oauth.token.User as UserModel).Account.id, t)
+ const reporterAccount = await AccountModel.load(res.locals.oauth.token.User.Account.id, t)
const abuseToCreate = {
reporterAccountId: reporterAccount.id,