summary refs log tree commit diff
path: root/api/src/routes/discoverable-guilds.ts
diff options
context:
space:
mode:
authorxnacly <matteogropp@protonmail.com>2021-09-03 23:31:56 +0200
committerxnacly <matteogropp@protonmail.com>2021-09-03 23:31:56 +0200
commit3aa1fa09de83361f5d0080a2f3174500d5a4710c (patch)
treeb63febe360fc6801fe73091dfb0bced454c73752 /api/src/routes/discoverable-guilds.ts
parentadded first draft of /discoverable-guilds (diff)
downloadserver-3aa1fa09de83361f5d0080a2f3174500d5a4710c.tar.xz
fixed /discoverable-guilds
Diffstat (limited to 'api/src/routes/discoverable-guilds.ts')
-rw-r--r--api/src/routes/discoverable-guilds.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/api/src/routes/discoverable-guilds.ts b/api/src/routes/discoverable-guilds.ts
index 79971917..0808727f 100644
--- a/api/src/routes/discoverable-guilds.ts
+++ b/api/src/routes/discoverable-guilds.ts
@@ -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 });
 });