🐛 fix In() query

This commit is contained in:
Flam3rboy
2021-09-13 12:22:59 +02:00
parent 9e3bc94e9d
commit 9b4457424d
3 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -137,7 +137,7 @@ router.post("/", route({ body: "RegisterSchema" }), async (req: Request, res: Re
if (!register.allowMultipleAccounts) {
// TODO: check if fingerprint was eligible generated
const exists = await User.findOne({ where: { fingerprints: In(fingerprint) } });
const exists = await User.findOne({ where: { fingerprints: fingerprint } });
if (exists) {
throw FieldErrors({
+1 -1
View File
@@ -132,7 +132,7 @@ router.patch("/", route({ body: "RolePositionUpdateSchema" }), async (req: Reque
await Promise.all(body.map(async (x) => Role.update({ guild_id, id: x.id }, { position: x.position })));
const roles = await Role.find({ guild_id, id: In(body.map((x) => x.id)) });
const roles = await Role.find({ where: body.map((x) => ({ id: x.id, guild_id })) });
await Promise.all(
roles.map((x) =>