summary refs log tree commit diff
path: root/api/src/routes/channels/#channel_id
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-03 03:37:55 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-03 03:37:55 +0200
commit36fe0ec0c8022cbbde23eb87ca00906629255de6 (patch)
tree43dba167ea6e790ac271b05710c41a539a0fd0d3 /api/src/routes/channels/#channel_id
parentfix #309 (diff)
downloadserver-36fe0ec0c8022cbbde23eb87ca00906629255de6.tar.xz
:bug: fix member + member list
Diffstat (limited to 'api/src/routes/channels/#channel_id')
-rw-r--r--api/src/routes/channels/#channel_id/messages/#message_id/reactions.ts2
-rw-r--r--api/src/routes/channels/#channel_id/permissions.ts2
-rw-r--r--api/src/routes/channels/#channel_id/typing.ts2
3 files changed, 3 insertions, 3 deletions
diff --git a/api/src/routes/channels/#channel_id/messages/#message_id/reactions.ts b/api/src/routes/channels/#channel_id/messages/#message_id/reactions.ts
index 37168940..f60484b5 100644
--- a/api/src/routes/channels/#channel_id/messages/#message_id/reactions.ts
+++ b/api/src/routes/channels/#channel_id/messages/#message_id/reactions.ts
@@ -136,7 +136,7 @@ router.put("/:emoji/:user_id", async (req: Request, res: Response) => {
 
 	await Message.update({ id: message_id, channel_id }, message);
 
-	const member = channel.guild_id && (await Member.findOneOrFail({ user_id: req.user_id }));
+	const member = channel.guild_id && (await Member.findOneOrFail({ id: req.user_id }));
 
 	await emitEvent({
 		event: "MESSAGE_REACTION_ADD",
diff --git a/api/src/routes/channels/#channel_id/permissions.ts b/api/src/routes/channels/#channel_id/permissions.ts
index 97f21659..9c49542b 100644
--- a/api/src/routes/channels/#channel_id/permissions.ts
+++ b/api/src/routes/channels/#channel_id/permissions.ts
@@ -20,7 +20,7 @@ router.put("/:overwrite_id", check({ allow: String, deny: String, type: Number,
 	if (body.type === 0) {
 		if (!(await Role.count({ id: overwrite_id }))) throw new HTTPError("role not found", 404);
 	} else if (body.type === 1) {
-		if (!(await Member.count({ user_id: overwrite_id }))) throw new HTTPError("user not found", 404);
+		if (!(await Member.count({ id: overwrite_id }))) throw new HTTPError("user not found", 404);
 	} else throw new HTTPError("type not supported", 501);
 
 	// @ts-ignore
diff --git a/api/src/routes/channels/#channel_id/typing.ts b/api/src/routes/channels/#channel_id/typing.ts
index aef99103..f1fb3c86 100644
--- a/api/src/routes/channels/#channel_id/typing.ts
+++ b/api/src/routes/channels/#channel_id/typing.ts
@@ -10,7 +10,7 @@ router.post("/", async (req: Request, res: Response) => {
 	const user_id = req.user_id;
 	const timestamp = Date.now();
 	const channel = await Channel.findOneOrFail({ id: channel_id });
-	const member = await Member.findOneOrFail({ user_id: user_id });
+	const member = await Member.findOneOrFail({ id: user_id });
 
 	await emitEvent({
 		event: "TYPING_START",