diff --git a/api/src/routes/guild-recommendations.ts b/src/api/routes/guild-recommendations.ts
index 1432f39c..bd0140d6 100644
--- a/api/src/routes/guild-recommendations.ts
+++ b/src/api/routes/guild-recommendations.ts
@@ -1,13 +1,14 @@
import { Guild, Config } from "@fosscord/util";
import { Router, Request, Response } from "express";
-import { route } from "@fosscord/api";
+import { route } from "..";
+import {Like} from "typeorm"
const router = Router();
router.get("/", route({}), async (req: Request, res: Response) => {
const { limit, personalization_disabled } = req.query;
- var showAllGuilds = Config.get().guild.discovery.showAllGuilds;
+ let showAllGuilds = Config.get().guild.discovery.showAllGuilds;
// ! 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)) });
@@ -16,7 +17,7 @@ router.get("/", route({}), async (req: Request, res: Response) => {
const guilds = showAllGuilds
? await Guild.find({ take: Math.abs(Number(limit || 24)) })
- : await Guild.find({ where: `"features" LIKE '%DISCOVERABLE%'`, take: Math.abs(Number(limit || 24)) });
+ : await Guild.find({ where: { features: Like('%DISCOVERABLE%') }, take: Math.abs(Number(limit || 24)) });
res.send({ recommended_guilds: guilds, load_id: `server_recs/${genLoadId(32)}`}).status(200);
});
|