diff options
Diffstat (limited to 'server/controllers/api/video-channel.ts')
-rw-r--r-- | server/controllers/api/video-channel.ts | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts index a7a36080b..50dc44f7c 100644 --- a/server/controllers/api/video-channel.ts +++ b/server/controllers/api/video-channel.ts | |||
@@ -27,7 +27,7 @@ import { logger } from '../../helpers/logger' | |||
27 | import { VideoModel } from '../../models/video/video' | 27 | import { VideoModel } from '../../models/video/video' |
28 | import { updateAvatarValidator } from '../../middlewares/validators/avatar' | 28 | import { updateAvatarValidator } from '../../middlewares/validators/avatar' |
29 | import { updateActorAvatarFile } from '../../lib/avatar' | 29 | import { updateActorAvatarFile } from '../../lib/avatar' |
30 | import { auditLoggerFactory, VideoChannelAuditView } from '../../helpers/audit-logger' | 30 | import { auditLoggerFactory, getAuditIdFromRes, VideoChannelAuditView } from '../../helpers/audit-logger' |
31 | import { resetSequelizeInstance } from '../../helpers/database-utils' | 31 | import { resetSequelizeInstance } from '../../helpers/database-utils' |
32 | 32 | ||
33 | const auditLogger = auditLoggerFactory('channels') | 33 | const auditLogger = auditLoggerFactory('channels') |
@@ -109,7 +109,7 @@ async function updateVideoChannelAvatar (req: express.Request, res: express.Resp | |||
109 | const avatar = await updateActorAvatarFile(avatarPhysicalFile, videoChannel.Actor, videoChannel) | 109 | const avatar = await updateActorAvatarFile(avatarPhysicalFile, videoChannel.Actor, videoChannel) |
110 | 110 | ||
111 | auditLogger.update( | 111 | auditLogger.update( |
112 | res.locals.oauth.token.User.Account.Actor.getIdentifier(), | 112 | getAuditIdFromRes(res), |
113 | new VideoChannelAuditView(videoChannel.toFormattedJSON()), | 113 | new VideoChannelAuditView(videoChannel.toFormattedJSON()), |
114 | oldVideoChannelAuditKeys | 114 | oldVideoChannelAuditKeys |
115 | ) | 115 | ) |
@@ -133,7 +133,7 @@ async function addVideoChannel (req: express.Request, res: express.Response) { | |||
133 | .catch(err => logger.error('Cannot set async actor keys for account %s.', videoChannelCreated.Actor.uuid, { err })) | 133 | .catch(err => logger.error('Cannot set async actor keys for account %s.', videoChannelCreated.Actor.uuid, { err })) |
134 | 134 | ||
135 | auditLogger.create( | 135 | auditLogger.create( |
136 | res.locals.oauth.token.User.Account.Actor.getIdentifier(), | 136 | getAuditIdFromRes(res), |
137 | new VideoChannelAuditView(videoChannelCreated.toFormattedJSON()) | 137 | new VideoChannelAuditView(videoChannelCreated.toFormattedJSON()) |
138 | ) | 138 | ) |
139 | logger.info('Video channel with uuid %s created.', videoChannelCreated.Actor.uuid) | 139 | logger.info('Video channel with uuid %s created.', videoChannelCreated.Actor.uuid) |
@@ -166,7 +166,7 @@ async function updateVideoChannel (req: express.Request, res: express.Response) | |||
166 | await sendUpdateActor(videoChannelInstanceUpdated, t) | 166 | await sendUpdateActor(videoChannelInstanceUpdated, t) |
167 | 167 | ||
168 | auditLogger.update( | 168 | auditLogger.update( |
169 | res.locals.oauth.token.User.Account.Actor.getIdentifier(), | 169 | getAuditIdFromRes(res), |
170 | new VideoChannelAuditView(videoChannelInstanceUpdated.toFormattedJSON()), | 170 | new VideoChannelAuditView(videoChannelInstanceUpdated.toFormattedJSON()), |
171 | oldVideoChannelAuditKeys | 171 | oldVideoChannelAuditKeys |
172 | ) | 172 | ) |
@@ -192,10 +192,7 @@ async function removeVideoChannel (req: express.Request, res: express.Response) | |||
192 | await sequelizeTypescript.transaction(async t => { | 192 | await sequelizeTypescript.transaction(async t => { |
193 | await videoChannelInstance.destroy({ transaction: t }) | 193 | await videoChannelInstance.destroy({ transaction: t }) |
194 | 194 | ||
195 | auditLogger.delete( | 195 | auditLogger.delete(getAuditIdFromRes(res), new VideoChannelAuditView(videoChannelInstance.toFormattedJSON())) |
196 | res.locals.oauth.token.User.Account.Actor.getIdentifier(), | ||
197 | new VideoChannelAuditView(videoChannelInstance.toFormattedJSON()) | ||
198 | ) | ||
199 | logger.info('Video channel with name %s and uuid %s deleted.', videoChannelInstance.name, videoChannelInstance.Actor.uuid) | 196 | logger.info('Video channel with name %s and uuid %s deleted.', videoChannelInstance.name, videoChannelInstance.Actor.uuid) |
200 | }) | 197 | }) |
201 | 198 | ||