From e7b44746e85a3f2809e8694da109d965b19e853c Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Fri, 9 Sep 2022 01:39:31 +0200 Subject: [PATCH] Added GET /links/ to the links.ts router --- api/routes/links.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/routes/links.ts b/api/routes/links.ts index 625ed47..974f9ce 100644 --- a/api/routes/links.ts +++ b/api/routes/links.ts @@ -7,6 +7,10 @@ import {ShortenedLink} from "../../models/ShortenedLink"; const app = Router(); +app.get("/", hasRank(Rank.TEAM_MEMBER), async (req: AuthenticatedRequest, res: Response) => { + res.json(await ShortenedLink.find({}, {_id: 0, __v: 0})); +}); + app.get("/:code", hasRank(Rank.TEAM_MEMBER), async (req: AuthenticatedRequest, res: Response) => { if (!req.params.code) return res.status(400).json({message: "You need to provide the shorten id"});