summary refs log tree commit diff
path: root/api/src/routes/channels/#channel_id/recipients.ts
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/routes/channels/#channel_id/recipients.ts')
-rw-r--r--api/src/routes/channels/#channel_id/recipients.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/api/src/routes/channels/#channel_id/recipients.ts b/api/src/routes/channels/#channel_id/recipients.ts
index c7beeee8..83b62049 100644
--- a/api/src/routes/channels/#channel_id/recipients.ts
+++ b/api/src/routes/channels/#channel_id/recipients.ts
@@ -1,9 +1,10 @@
 import { Request, Response, Router } from "express";
 import { Channel, ChannelRecipientAddEvent, ChannelType, DiscordApiErrors, DmChannelDTO, emitEvent, PublicUserProjection, Recipient, User } from "@fosscord/util";
+import { route } from "@fosscord/api"
 
 const router: Router = Router();
 
-router.put("/:user_id", async (req: Request, res: Response) => {
+router.put("/:user_id", route({}), async (req: Request, res: Response) => {
 	const { channel_id, user_id } = req.params;
 	const channel = await Channel.findOneOrFail({ where: { id: channel_id }, relations: ["recipients"] });
 
@@ -39,7 +40,7 @@ router.put("/:user_id", async (req: Request, res: Response) => {
 	}
 });
 
-router.delete("/:user_id", async (req: Request, res: Response) => {
+router.delete("/:user_id", route({}), async (req: Request, res: Response) => {
 	const { channel_id, user_id } = req.params;
 	const channel = await Channel.findOneOrFail({ where: { id: channel_id }, relations: ["recipients"] });
 	if (!(channel.type === ChannelType.GROUP_DM && (channel.owner_id === req.user_id || user_id === req.user_id)))