mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-23 02:42:28 +01:00
added first draft of /discoverable-guilds
This commit is contained in:
parent
7d2f068886
commit
26cc5ac0f9
14
api/src/routes/discoverable-guilds.ts
Normal file
14
api/src/routes/discoverable-guilds.ts
Normal file
@ -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;
|
Loading…
Reference in New Issue
Block a user