summary refs log tree commit diff
path: root/src/api/routes/users
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-16 04:41:40 +0100
committerRory& <root@rory.gay>2025-12-16 04:59:13 +0100
commit7b38f938171ceb14da144073bdb02c9e4b8dde1c (patch)
treeb04ed790549dde1c52bb360a29c2f70c85ede0a6 /src/api/routes/users
parentEndpointPrivate for api (diff)
downloadserver-ts-7b38f938171ceb14da144073bdb02c9e4b8dde1c.tar.xz
Allow opting out of persisting instance bans on user delete endpoint
Diffstat (limited to 'src/api/routes/users')
-rw-r--r--src/api/routes/users/#user_id/delete.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/api/routes/users/#user_id/delete.ts b/src/api/routes/users/#user_id/delete.ts

index 50494a23..be361f18 100644 --- a/src/api/routes/users/#user_id/delete.ts +++ b/src/api/routes/users/#user_id/delete.ts
@@ -62,7 +62,7 @@ router.post( select: [...PrivateUserProjection, "data"], }); - if (!(await InstanceBan.findOne({ where: { user_id: user.id } }))) + if ((body?.persistInstanceBan ?? true) && !(await InstanceBan.findOne({ where: { user_id: user.id } }))) await InstanceBan.create({ user_id: user.id, reason: body?.reason ?? "<legacy instance ban API - no reason specified>" }).save(); // prevent bugginess with clients - delete all DMs, only having half of the conversation is quite useless anyhow