From abdce76df4b6aa3a063b496e6c0575c54e9fa397 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Tue, 21 Sep 2021 22:52:30 +0200 Subject: :sparkles: generate openapi documentation --- api/src/routes/channels/#channel_id/recipients.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'api/src/routes/channels/#channel_id') 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))) -- cgit 1.4.1