summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorwhinis <whinis@whinis.com>2026-02-25 08:57:05 -0500
committerRory& <root@rory.gay>2026-02-26 06:55:18 +0100
commit3e7ecbc4a1155d01e2a7e085d891d720435b19b7 (patch)
tree7b174eed072c04729cd9a710613f754c5ca169ba /src/api
parentAdd /_spacebar/api/version - resolves #1222 (diff)
downloadserver-ts-3e7ecbc4a1155d01e2a7e085d891d720435b19b7.tar.xz
added clean_data to places after a member is created but not constructed to allow proper json creation.
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/channels/#channel_id/messages/index.ts1
-rw-r--r--src/api/util/handlers/Message.ts1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/api/routes/channels/#channel_id/messages/index.ts b/src/api/routes/channels/#channel_id/messages/index.ts

index 42bb8273..46ef45f0 100644 --- a/src/api/routes/channels/#channel_id/messages/index.ts +++ b/src/api/routes/channels/#channel_id/messages/index.ts
@@ -481,6 +481,7 @@ router.post( where: { id: req.user_id, guild_id: message.guild_id }, relations: { roles: true }, }); + message.member.clean_data(); } // eslint-disable-next-line @typescript-eslint/ban-ts-comment diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts
index 4dc4fb83..c0d26dc5 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts
@@ -171,6 +171,7 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> { message.author = await User.findOneOrFail({ where: { id: opts.author_id }, }); + message.author.clean_data(); const rights = await getRights(opts.author_id); rights.hasThrow("SEND_MESSAGES"); }