diff options
author | xnacly <matteogropp@protonmail.com> | 2021-09-03 21:40:44 +0200 |
---|---|---|
committer | xnacly <matteogropp@protonmail.com> | 2021-09-03 21:40:44 +0200 |
commit | 7beee199064fc1fe1c8553b0f6531d0c652134a7 (patch) | |
tree | 26f90ae9f8a335702979f4827a7398686c3aac33 /api/src/routes/discoverable-guilds.ts | |
parent | readded todos (diff) | |
download | server-7beee199064fc1fe1c8553b0f6531d0c652134a7.tar.xz |
added first draft of /discoverable-guilds
Diffstat (limited to 'api/src/routes/discoverable-guilds.ts')
-rw-r--r-- | api/src/routes/discoverable-guilds.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/api/src/routes/discoverable-guilds.ts b/api/src/routes/discoverable-guilds.ts new file mode 100644 index 00000000..79971917 --- /dev/null +++ b/api/src/routes/discoverable-guilds.ts @@ -0,0 +1,14 @@ +import { Guild } from "@fosscord/util"; +import { Router, Request, Response } from "express"; +import { In } from "typeorm"; + +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)) }); + res.send({ guilds: guilds }); +}); + +export default router; |