Add logs endpoint
[oweals/peertube.git] / server / helpers / audit-logger.ts
index 00311fce13dbf7b6a5b0a81e15cd487932845ae6..af37bce16cd0da150f6d780df1e7b6346c42e404 100644 (file)
@@ -6,13 +6,12 @@ import * as flatten from 'flat'
 import * as winston from 'winston'
 import { CONFIG } from '../initializers'
 import { jsonLoggerFormat, labelFormatter } from './logger'
-import { VideoDetails, User, VideoChannel, VideoAbuse, VideoImport } from '../../shared'
+import { User, VideoAbuse, VideoChannel, VideoDetails, VideoImport } from '../../shared'
 import { VideoComment } from '../../shared/models/videos/video-comment.model'
 import { CustomConfig } from '../../shared/models/server/custom-config.model'
-import { UserModel } from '../models/account/user'
 
 function getAuditIdFromRes (res: express.Response) {
-  return (res.locals.oauth.token.User as UserModel).username
+  return res.locals.oauth.token.User.username
 }
 
 enum AUDIT_TYPE {
@@ -117,7 +116,8 @@ const videoKeysToKeep = [
   'channel-uuid',
   'channel-name',
   'support',
-  'commentsEnabled'
+  'commentsEnabled',
+  'downloadEnabled'
 ]
 class VideoAuditView extends EntityAuditView {
   constructor (private video: VideoDetails) {