Updated the license.ts

This commit is contained in:
Mathias Wagner 2023-09-10 13:39:18 +02:00
parent 83e4c7b70e
commit cc83c78fc8
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -9,6 +9,9 @@ app.get("/:projectId/list", async (req: Request, res: Response) => {
const page = Number(req.query.page) || 0;
const limit = Number(req.query.limit) || 100;
if (page < 0) return sendError(res, 400, 4, "The page number cannot be negative");
if (limit < 1) return sendError(res, 400, 4, "The limit cannot be less than 1");
const licenses = await listLicensesPaginated(String(req.user?._id), req.params.projectId, page, limit);
if ("code" in licenses) return res.json(licenses);