From: Chocobozzz Date: Thu, 4 Jan 2018 13:53:25 +0000 (+0100) Subject: Fix avatar update X-Git-Tag: v0.0.1-alpha~52 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bb82394c0d41cc939a35782e50ce908c92e3ecfe;p=oweals%2Fpeertube.git Fix avatar update --- diff --git a/server/controllers/api/users.ts b/server/controllers/api/users.ts index d8ecbdbe2..2d77a5249 100644 --- a/server/controllers/api/users.ts +++ b/server/controllers/api/users.ts @@ -249,11 +249,12 @@ async function updateMyAvatar (req: express.Request, res: express.Response, next await unlinkPromise(source) const avatar = await sequelizeTypescript.transaction(async t => { - await updateActorAvatarInstance(actor, avatarName, t) + const updatedActor = await updateActorAvatarInstance(actor, avatarName, t) + await updatedActor.save({ transaction: t }) await sendUpdateUser(user, t) - return avatar + return updatedActor.Avatar }) return res