Added GET /links/ to the links.ts router
This commit is contained in:
parent
b62a6d5f08
commit
e7b44746e8
@ -7,6 +7,10 @@ import {ShortenedLink} from "../../models/ShortenedLink";
|
|||||||
|
|
||||||
const app = Router();
|
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) => {
|
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"});
|
if (!req.params.code) return res.status(400).json({message: "You need to provide the shorten id"});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user