diff --git a/util/src/entities/Member.ts b/util/src/entities/Member.ts
index f6d99125..e7e97b7c 100644
--- a/util/src/entities/Member.ts
+++ b/util/src/entities/Member.ts
@@ -117,7 +117,7 @@ export class Member extends BaseClassWithoutId {
// read_state: ReadState;
static async IsInGuildOrFail(user_id: string, guild_id: string) {
- if (await Member.count({ id: user_id, guild: { id: guild_id } })) return true;
+ if (await Member.count({ where: { id: user_id, guild: { id: guild_id } } })) return true;
throw new HTTPError("You are not member of this guild", 403);
}
@@ -183,7 +183,7 @@ export class Member extends BaseClassWithoutId {
relations: ["user", "roles"], // we don't want to load the role objects just the ids
select: ["index"],
}),
- await Role.findOneOrFail({ id: role_id, guild_id }),
+ await Role.findOneOrFail({ where: { id: role_id, guild_id } }),
]);
member.roles = member.roles.filter((x) => x.id == role_id);
@@ -233,7 +233,7 @@ export class Member extends BaseClassWithoutId {
throw DiscordApiErrors.USER_BANNED;
}
const { maxGuilds } = Config.get().limits.user;
- const guild_count = await Member.count({ id: user_id });
+ const guild_count = await Member.count({ where: { id: user_id } });
if (guild_count >= maxGuilds) {
throw new HTTPError(`You are at the ${maxGuilds} server limit.`, 403);
}
@@ -245,7 +245,7 @@ export class Member extends BaseClassWithoutId {
relations: PublicGuildRelations,
});
- if (await Member.count({ id: user.id, guild: { id: guild_id } }))
+ if (await Member.count({ where: { id: user.id, guild: { id: guild_id } } }))
throw new HTTPError("You are already a member of this guild", 400);
const member = {
|