From bb84bc83e5093126898486fd550062006a678e3e Mon Sep 17 00:00:00 2001 From: dank074 Date: Wed, 9 Apr 2025 18:42:56 -0500 Subject: [PATCH] add `author` to query in pins API --- src/api/routes/channels/#channel_id/pins.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/api/routes/channels/#channel_id/pins.ts b/src/api/routes/channels/#channel_id/pins.ts index f9586469..96162870 100644 --- a/src/api/routes/channels/#channel_id/pins.ts +++ b/src/api/routes/channels/#channel_id/pins.ts @@ -49,6 +49,7 @@ router.put( const message = await Message.findOneOrFail({ where: { id: message_id }, + relations: ["author"], }); // * in dm channels anyone can pin messages -> only check for guilds @@ -133,6 +134,7 @@ router.delete( const message = await Message.findOneOrFail({ where: { id: message_id }, + relations: ["author"], }); if (message.guild_id) req.permission?.hasThrow("MANAGE_MESSAGES");