summary refs log tree commit diff
path: root/api/src/routes/channels/#channel_id/recipients.ts
diff options
context:
space:
mode:
authorAlTech98 <altech123159@gmail.com>2021-09-18 18:36:29 +0200
committerAlTech98 <altech123159@gmail.com>2021-09-18 18:36:29 +0200
commitada95b6c3938f9aa644aebc2bb26dbb073aa3324 (patch)
tree8bd28dfd7a6674becc41da906cea475448fa95b0 /api/src/routes/channels/#channel_id/recipients.ts
parentFix gateway not listening for new channels events (diff)
downloadserver-ada95b6c3938f9aa644aebc2bb26dbb073aa3324.tar.xz
Removed ChannelService, more fixes
Diffstat (limited to 'api/src/routes/channels/#channel_id/recipients.ts')
-rw-r--r--api/src/routes/channels/#channel_id/recipients.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/api/src/routes/channels/#channel_id/recipients.ts b/api/src/routes/channels/#channel_id/recipients.ts
index d88b38f3..c7beeee8 100644
--- a/api/src/routes/channels/#channel_id/recipients.ts
+++ b/api/src/routes/channels/#channel_id/recipients.ts
@@ -1,5 +1,5 @@
 import { Request, Response, Router } from "express";
-import { Channel, ChannelRecipientAddEvent, ChannelService, ChannelType, DiscordApiErrors, DmChannelDTO, emitEvent, PublicUserProjection, Recipient, User } from "@fosscord/util";
+import { Channel, ChannelRecipientAddEvent, ChannelType, DiscordApiErrors, DmChannelDTO, emitEvent, PublicUserProjection, Recipient, User } from "@fosscord/util";
 
 const router: Router = Router();
 
@@ -13,7 +13,7 @@ router.put("/:user_id", async (req: Request, res: Response) => {
 			user_id
 		].unique()
 
-		const new_channel = await ChannelService.createDMChannel(recipients, req.user_id)
+		const new_channel = await Channel.createDMChannel(recipients, req.user_id)
 		return res.status(201).json(new_channel);
 	} else {
 		if (channel.recipients!.map(r => r.user_id).includes(user_id)) {
@@ -49,7 +49,7 @@ router.delete("/:user_id", async (req: Request, res: Response) => {
 		throw DiscordApiErrors.INVALID_RECIPIENT //TODO is this the right error?
 	}
 
-	await ChannelService.removeRecipientFromChannel(channel, user_id)
+	await Channel.removeRecipientFromChannel(channel, user_id)
 
 	return res.sendStatus(204);
 });