aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users/me.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-28 15:46:56 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-09-05 10:17:02 +0200
commit589d9f55f6f3f0d069d4bbb207d3d20769cc4ded (patch)
tree0826bda439beb523e458513672a3d06c924e1760 /server/controllers/api/users/me.ts
parent43d0ea7f4b88d52097172cc0c1831edd7e492503 (diff)
downloadPeerTube-589d9f55f6f3f0d069d4bbb207d3d20769cc4ded.tar.gz
PeerTube-589d9f55f6f3f0d069d4bbb207d3d20769cc4ded.tar.zst
PeerTube-589d9f55f6f3f0d069d4bbb207d3d20769cc4ded.zip
Add config instance warning modal
Diffstat (limited to 'server/controllers/api/users/me.ts')
-rw-r--r--server/controllers/api/users/me.ts12
1 files changed, 6 insertions, 6 deletions
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) {
190 } 190 }
191 } 191 }
192 192
193 if (body.displayName !== undefined || body.description !== undefined) { 193 await sequelizeTypescript.transaction(async t => {
194 await sequelizeTypescript.transaction(async t => { 194 await user.save({ transaction: t })
195 const userAccount = await AccountModel.load(user.Account.id, t)
196 195
197 await user.save({ transaction: t }) 196 if (body.displayName !== undefined || body.description !== undefined) {
197 const userAccount = await AccountModel.load(user.Account.id, t)
198 198
199 if (body.displayName !== undefined) userAccount.name = body.displayName 199 if (body.displayName !== undefined) userAccount.name = body.displayName
200 if (body.description !== undefined) userAccount.description = body.description 200 if (body.description !== undefined) userAccount.description = body.description
201 await userAccount.save({ transaction: t }) 201 await userAccount.save({ transaction: t })
202 202
203 await sendUpdateActor(userAccount, t) 203 await sendUpdateActor(userAccount, t)
204 }) 204 }
205 } 205 })
206 206
207 if (sendVerificationEmail === true) { 207 if (sendVerificationEmail === true) {
208 await sendVerifyUserEmail(user, true) 208 await sendVerifyUserEmail(user, true)