summary refs log tree commit diff
path: root/api/src/routes/guilds/#guild_id/index.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-02 19:50:05 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-02 19:50:05 +0200
commitd29ccaf623910eea90852fa28cd8ec191bd7afff (patch)
tree040af2cced2548560403efb72be4d026f41908f9 /api/src/routes/guilds/#guild_id/index.ts
parent:art: update openapi title (diff)
downloadserver-d29ccaf623910eea90852fa28cd8ec191bd7afff.tar.xz
:sparkles: add user_id field to Member
Diffstat (limited to 'api/src/routes/guilds/#guild_id/index.ts')
-rw-r--r--api/src/routes/guilds/#guild_id/index.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/api/src/routes/guilds/#guild_id/index.ts b/api/src/routes/guilds/#guild_id/index.ts
index 6f55be3b..80b5c609 100644
--- a/api/src/routes/guilds/#guild_id/index.ts
+++ b/api/src/routes/guilds/#guild_id/index.ts
@@ -14,8 +14,8 @@ router.get("/", async (req: Request, res: Response) => {
 
 	const [guild, member_count, member] = await Promise.all([
 		Guild.findOneOrFail({ id: guild_id }),
-		Member.count({ guild: { id: guild_id }, id: req.user_id }),
-		Member.findOneOrFail({ id: req.user_id })
+		Member.count({ guild_id: guild_id, user_id: req.user_id }),
+		Member.findOneOrFail({ user_id: req.user_id })
 	]);
 	if (!member_count) throw new HTTPError("You are not a member of the guild you are trying to access", 401);