diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-04 14:53:25 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-04 14:53:25 +0100 |
commit | bb82394c0d41cc939a35782e50ce908c92e3ecfe (patch) | |
tree | b99573f83427daa488f33e5de6806c451c9633bb /server/controllers/api | |
parent | a5625b416797fa20f7cccead6201f3faf9427080 (diff) | |
download | PeerTube-bb82394c0d41cc939a35782e50ce908c92e3ecfe.tar.gz PeerTube-bb82394c0d41cc939a35782e50ce908c92e3ecfe.tar.zst PeerTube-bb82394c0d41cc939a35782e50ce908c92e3ecfe.zip |
Fix avatar update
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/users.ts | 5 |
1 files changed, 3 insertions, 2 deletions
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 | |||
249 | await unlinkPromise(source) | 249 | await unlinkPromise(source) |
250 | 250 | ||
251 | const avatar = await sequelizeTypescript.transaction(async t => { | 251 | const avatar = await sequelizeTypescript.transaction(async t => { |
252 | await updateActorAvatarInstance(actor, avatarName, t) | 252 | const updatedActor = await updateActorAvatarInstance(actor, avatarName, t) |
253 | await updatedActor.save({ transaction: t }) | ||
253 | 254 | ||
254 | await sendUpdateUser(user, t) | 255 | await sendUpdateUser(user, t) |
255 | 256 | ||
256 | return avatar | 257 | return updatedActor.Avatar |
257 | }) | 258 | }) |
258 | 259 | ||
259 | return res | 260 | return res |