From 589d9f55f6f3f0d069d4bbb207d3d20769cc4ded Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 28 Aug 2019 15:46:56 +0200 Subject: Add config instance warning modal --- server/controllers/api/users/me.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'server') diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.ts index fb1ddbc6d..bf872ca52 100644 --- a/server/controllers/api/users/me.ts +++ b/server/controllers/api/users/me.ts @@ -190,19 +190,19 @@ async function updateMe (req: express.Request, res: express.Response) { } } - if (body.displayName !== undefined || body.description !== undefined) { - await sequelizeTypescript.transaction(async t => { - const userAccount = await AccountModel.load(user.Account.id, t) + await sequelizeTypescript.transaction(async t => { + await user.save({ transaction: t }) - await user.save({ transaction: t }) + if (body.displayName !== undefined || body.description !== undefined) { + const userAccount = await AccountModel.load(user.Account.id, t) if (body.displayName !== undefined) userAccount.name = body.displayName if (body.description !== undefined) userAccount.description = body.description await userAccount.save({ transaction: t }) await sendUpdateActor(userAccount, t) - }) - } + } + }) if (sendVerificationEmail === true) { await sendVerifyUserEmail(user, true) -- cgit v1.2.3