diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-09-21 22:52:30 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-09-21 22:52:30 +0200 |
commit | abdce76df4b6aa3a063b496e6c0575c54e9fa397 (patch) | |
tree | c135233da7c327eeb52f143a2632f5d5bd4b65b5 /api/src/routes/channels/#channel_id | |
parent | :bug: fix unittests (diff) | |
download | server-abdce76df4b6aa3a063b496e6c0575c54e9fa397.tar.xz |
:sparkles: generate openapi documentation
Diffstat (limited to 'api/src/routes/channels/#channel_id')
-rw-r--r-- | api/src/routes/channels/#channel_id/recipients.ts | 5 |
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))) |