fixed /discoverable-guilds

This commit is contained in:
xnacly 2021-09-03 23:31:56 +02:00
parent 26cc5ac0f9
commit 25060ed06e

View File

@ -7,7 +7,10 @@ const router = Router();
router.get("/", async (req: Request, res: Response) => {
const { limit } = req.params;
const guilds = await Guild.find({ where: { features: "DISCOVERABLE" } }); //, take: Math.abs(Number(limit)) });
// ! this only works using SQL querys
// TODO: implement this with default typeorm query
// const guilds = await Guild.find({ where: { features: "DISCOVERABLE" } }); //, take: Math.abs(Number(limit)) });
const guilds = await Guild.find({ where: `"features" LIKE 'COMMUNITY'`, take: Math.abs(Number(limit)) });
res.send({ guilds: guilds });
});