From ea5d31384a9096ba8d5a7ade65e7891ffb1156af Mon Sep 17 00:00:00 2001 From: Theis Gaedigk Date: Sun, 21 Sep 2025 10:45:31 +0200 Subject: [PATCH] added a bit documentation to the api file --- backend/routes/apiV2.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/routes/apiV2.js b/backend/routes/apiV2.js index 1cfb906..1b81426 100644 --- a/backend/routes/apiV2.js +++ b/backend/routes/apiV2.js @@ -46,6 +46,7 @@ router.post("/controlInSafe/:key/:itemId/:state", async (req, res) => { } }); +// Route for API to get a loan by its code router.get("/getLoanByCode/:key/:loan_code", async (req, res) => { if (req.params.key === process.env.ADMIN_ID) { const loan_code = req.params.loan_code; @@ -59,7 +60,7 @@ router.get("/getLoanByCode/:key/:loan_code", async (req, res) => { } }); -// Route for API to set the return date +// Route for API to set the return date by the loan code router.post("/setReturnDate/:key/:loan_code", async (req, res) => { if (req.params.key === process.env.ADMIN_ID) { const loanCode = req.params.loan_code; @@ -75,7 +76,7 @@ router.post("/setReturnDate/:key/:loan_code", async (req, res) => { } }); -// Route for API to set the take away date +// Route for API to set the take away date by the loan code router.post("/setTakeDate/:key/:loan_code", async (req, res) => { if (req.params.key === process.env.ADMIN_ID) { const loanCode = req.params.loan_code; @@ -91,6 +92,7 @@ router.post("/setTakeDate/:key/:loan_code", async (req, res) => { } }); +// Route for API to get ALL loans from the database without sensitive info router.get("/allLoans", async (req, res) => { const result = await getAllLoansV2(); if (result.success) {