aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users/index.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-01-04 09:54:48 +0100
committerChocobozzz <me@florianbigard.com>2021-01-04 09:54:48 +0100
commit2dbc170da35c9f88770653cd3114f4c59d482094 (patch)
tree0befce119e2fe3a750b000cb8b971d12e41550a3 /server/controllers/api/users/index.ts
parentafd4ee86ddb97f8d49585fddd318bedcd3ad55b8 (diff)
downloadPeerTube-2dbc170da35c9f88770653cd3114f4c59d482094.tar.gz
PeerTube-2dbc170da35c9f88770653cd3114f4c59d482094.tar.zst
PeerTube-2dbc170da35c9f88770653cd3114f4c59d482094.zip
Add missing audit log if the user deletes its account
Diffstat (limited to 'server/controllers/api/users/index.ts')
-rw-r--r--server/controllers/api/users/index.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts
index d743a9912..c3190e731 100644
--- a/server/controllers/api/users/index.ts
+++ b/server/controllers/api/users/index.ts
@@ -305,10 +305,10 @@ async function listUsers (req: express.Request, res: express.Response) {
305async function removeUser (req: express.Request, res: express.Response) { 305async function removeUser (req: express.Request, res: express.Response) {
306 const user = res.locals.user 306 const user = res.locals.user
307 307
308 await user.destroy()
309
310 auditLogger.delete(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON())) 308 auditLogger.delete(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON()))
311 309
310 await user.destroy()
311
312 Hooks.runAction('action:api.user.deleted', { user }) 312 Hooks.runAction('action:api.user.deleted', { user })
313 313
314 return res.sendStatus(HttpStatusCode.NO_CONTENT_204) 314 return res.sendStatus(HttpStatusCode.NO_CONTENT_204)