diff options
author | Featyre <twooter.0g179@simplelogin.co> | 2022-01-23 23:55:43 +0800 |
---|---|---|
committer | Featyre <twooter.0g179@simplelogin.co> | 2022-01-23 23:55:43 +0800 |
commit | a5e06cd02193afe24292a5ae21a9f7e663e2f176 (patch) | |
tree | ab5aa50b774c89e5667717a01c405413782aaa30 /api/src/routes/guild-recommendations.ts | |
parent | Branding updates (diff) | |
download | server-a5e06cd02193afe24292a5ae21a9f7e663e2f176.tar.xz |
Partial integration of categories and discovery
Diffstat (limited to 'api/src/routes/guild-recommendations.ts')
-rw-r--r-- | api/src/routes/guild-recommendations.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/api/src/routes/guild-recommendations.ts b/api/src/routes/guild-recommendations.ts index 503b19b7..47017a6f 100644 --- a/api/src/routes/guild-recommendations.ts +++ b/api/src/routes/guild-recommendations.ts @@ -6,14 +6,14 @@ import { route } from "@fosscord/api"; const router = Router(); router.get("/", route({}), async (req: Request, res: Response) => { - const { limit, personalization_disabled } = req.params; + const { limit, personalization_disabled } = req.query; var showAllGuilds = Config.get().guild.showAllGuildsInDiscovery; // ! 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 = showAllGuilds - ? await Guild.find({ take: Math.abs(Number(limit || 20)) }) - : await Guild.find({ where: `"features" LIKE '%COMMUNITY%'`, take: Math.abs(Number(limit || 100)) }); + ? await Guild.find({ take: Math.abs(Number(limit || 24)) }) + : await Guild.find({ where: `"features" LIKE '%COMMUNITY%'`, take: Math.abs(Number(limit || 24)) }); res.send({ recommended_guilds: guilds }); }); |