diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-20 11:31:48 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-09-20 11:45:59 +0200 |
commit | f201a749929ec8094a7ba6bcab7b196870ca5a5e (patch) | |
tree | 76c0f5f8a90705b5badb83f64ffdc395e468c1a9 /server/controllers/api/video-channel.ts | |
parent | 91411dba928678c15a5e99d9795ae061909e397d (diff) | |
download | PeerTube-f201a749929ec8094a7ba6bcab7b196870ca5a5e.tar.gz PeerTube-f201a749929ec8094a7ba6bcab7b196870ca5a5e.tar.zst PeerTube-f201a749929ec8094a7ba6bcab7b196870ca5a5e.zip |
Cache user token
Diffstat (limited to 'server/controllers/api/video-channel.ts')
-rw-r--r-- | server/controllers/api/video-channel.ts | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts index 8fc340224..ff6bbe44c 100644 --- a/server/controllers/api/video-channel.ts +++ b/server/controllers/api/video-channel.ts | |||
@@ -56,7 +56,7 @@ videoChannelRouter.post('/:nameWithHost/avatar/pick', | |||
56 | // Check the rights | 56 | // Check the rights |
57 | asyncMiddleware(videoChannelsUpdateValidator), | 57 | asyncMiddleware(videoChannelsUpdateValidator), |
58 | updateAvatarValidator, | 58 | updateAvatarValidator, |
59 | asyncMiddleware(updateVideoChannelAvatar) | 59 | asyncRetryTransactionMiddleware(updateVideoChannelAvatar) |
60 | ) | 60 | ) |
61 | 61 | ||
62 | videoChannelRouter.put('/:nameWithHost', | 62 | videoChannelRouter.put('/:nameWithHost', |
@@ -107,13 +107,9 @@ async function updateVideoChannelAvatar (req: express.Request, res: express.Resp | |||
107 | const videoChannel = res.locals.videoChannel as VideoChannelModel | 107 | const videoChannel = res.locals.videoChannel as VideoChannelModel |
108 | const oldVideoChannelAuditKeys = new VideoChannelAuditView(videoChannel.toFormattedJSON()) | 108 | const oldVideoChannelAuditKeys = new VideoChannelAuditView(videoChannel.toFormattedJSON()) |
109 | 109 | ||
110 | const avatar = await updateActorAvatarFile(avatarPhysicalFile, videoChannel.Actor, videoChannel) | 110 | const avatar = await updateActorAvatarFile(avatarPhysicalFile, videoChannel) |
111 | 111 | ||
112 | auditLogger.update( | 112 | auditLogger.update(getAuditIdFromRes(res), new VideoChannelAuditView(videoChannel.toFormattedJSON()), oldVideoChannelAuditKeys) |
113 | getAuditIdFromRes(res), | ||
114 | new VideoChannelAuditView(videoChannel.toFormattedJSON()), | ||
115 | oldVideoChannelAuditKeys | ||
116 | ) | ||
117 | 113 | ||
118 | return res | 114 | return res |
119 | .json({ | 115 | .json({ |