summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-04-12 11:45:51 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-04-12 11:45:51 +1000
commit2d50adf151acaadbe1965924469113a6caf50e06 (patch)
treed93bcc62baf1a9da62e2b9fe656d7094cb12200f /src
parentdon't allow editing @everyone role (diff)
downloadserver-2d50adf151acaadbe1965924469113a6caf50e06.tar.xz
Add missing route middleware to messages route
Diffstat (limited to 'src')
-rw-r--r--src/api/routes/channels/#channel_id/messages/index.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/api/routes/channels/#channel_id/messages/index.ts b/src/api/routes/channels/#channel_id/messages/index.ts
index c871087a..7f0c9fb5 100644
--- a/src/api/routes/channels/#channel_id/messages/index.ts
+++ b/src/api/routes/channels/#channel_id/messages/index.ts
@@ -73,9 +73,11 @@ export function isTextChannel(type: ChannelType): boolean {
 
 // https://discord.com/developers/docs/resources/channel#create-message
 // get messages
-router.get("/", async (req: Request, res: Response) => {
+router.get("/", route({}), async (req: Request, res: Response) => {
 	const channel_id = req.params.channel_id;
-	const channel = await Channel.findOneOrFail({ where: { id: channel_id } });
+	const channel = await Channel.findOneOrFail({
+		where: { id: channel_id },
+	});
 	if (!channel) throw new HTTPError("Channel not found", 404);
 
 	isTextChannel(channel.type);