+async function updateVideoAbuse (req: express.Request, res: express.Response) {
+ const videoAbuse: VideoAbuseModel = res.locals.videoAbuse
+
+ if (req.body.moderationComment !== undefined) videoAbuse.moderationComment = req.body.moderationComment
+ if (req.body.state !== undefined) videoAbuse.state = req.body.state
+
+ await sequelizeTypescript.transaction(t => {
+ return videoAbuse.save({ transaction: t })
+ })
+
+ // Do not send the delete to other instances, we updated OUR copy of this video abuse
+
+ return res.type('json').status(204).end()
+}
+
+async function deleteVideoAbuse (req: express.Request, res: express.Response) {
+ const videoAbuse: VideoAbuseModel = res.locals.videoAbuse
+
+ await sequelizeTypescript.transaction(t => {
+ return videoAbuse.destroy({ transaction: t })
+ })
+
+ // Do not send the delete to other instances, we delete OUR copy of this video abuse
+
+ return res.type('json').status(204).end()
+}
+