From bb82394c0d41cc939a35782e50ce908c92e3ecfe Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 4 Jan 2018 14:53:25 +0100 Subject: Fix avatar update --- server/controllers/api/users.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'server/controllers') 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 -- cgit v1.2.3