]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/video-channel.ts
Add explicit error message that changing video ownership only works with local accou...
[github/Chocobozzz/PeerTube.git] / server / controllers / api / video-channel.ts
index 8fc34022430bb61dc3aff14ced7164581d71fda2..1fa842d9c984b2a112c6184831666e113c5e9bb1 100644 (file)
@@ -46,7 +46,7 @@ videoChannelRouter.get('/',
 
 videoChannelRouter.post('/',
   authenticate,
-  videoChannelsAddValidator,
+  asyncMiddleware(videoChannelsAddValidator),
   asyncRetryTransactionMiddleware(addVideoChannel)
 )
 
@@ -107,13 +107,9 @@ async function updateVideoChannelAvatar (req: express.Request, res: express.Resp
   const videoChannel = res.locals.videoChannel as VideoChannelModel
   const oldVideoChannelAuditKeys = new VideoChannelAuditView(videoChannel.toFormattedJSON())
 
-  const avatar = await updateActorAvatarFile(avatarPhysicalFile, videoChannel.Actor, videoChannel)
+  const avatar = await updateActorAvatarFile(avatarPhysicalFile, videoChannel)
 
-  auditLogger.update(
-    getAuditIdFromRes(res),
-    new VideoChannelAuditView(videoChannel.toFormattedJSON()),
-    oldVideoChannelAuditKeys
-  )
+  auditLogger.update(getAuditIdFromRes(res), new VideoChannelAuditView(videoChannel.toFormattedJSON()), oldVideoChannelAuditKeys)
 
   return res
     .json({