X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fapi%2Fusers%2Fme.ts;h=f78294f17ec205b7f5ba022181ec7e5b9944e7a7;hb=64cc5e8575fda47b281ae20abf0020e27fc8ce7c;hp=eba1e7eddbe5278e852c148835b273b50ffa3536;hpb=91411dba928678c15a5e99d9795ae061909e397d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.ts index eba1e7edd..f78294f17 100644 --- a/server/controllers/api/users/me.ts +++ b/server/controllers/api/users/me.ts @@ -87,7 +87,7 @@ meRouter.get('/me/videos/:videoId/rating', meRouter.put('/me', authenticate, - usersUpdateMeValidator, + asyncMiddleware(usersUpdateMeValidator), asyncRetryTransactionMiddleware(updateMe) ) @@ -327,6 +327,7 @@ async function updateMe (req: express.Request, res: express.Response, next: expr if (body.password !== undefined) user.password = body.password if (body.email !== undefined) user.email = body.email if (body.nsfwPolicy !== undefined) user.nsfwPolicy = body.nsfwPolicy + if (body.webTorrentPolicy !== undefined) user.webTorrentPolicy = body.webTorrentPolicy if (body.autoPlayVideo !== undefined) user.autoPlayVideo = body.autoPlayVideo await sequelizeTypescript.transaction(async t => { @@ -353,7 +354,7 @@ async function updateMyAvatar (req: express.Request, res: express.Response, next const userAccount = await AccountModel.load(user.Account.id) - const avatar = await updateActorAvatarFile(avatarPhysicalFile, userAccount.Actor, userAccount) + const avatar = await updateActorAvatarFile(avatarPhysicalFile, userAccount) auditLogger.update(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON()), oldUserAuditView)