fullfilled landingpage

This commit is contained in:
2025-09-21 00:48:28 +02:00
parent 679ef7dcbd
commit ab93c9959d
3 changed files with 222 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import {
setReturnDateV2,
setTakeDateV2,
getLoanByCodeV2,
getAllLoansV2,
} from "../services/database.js";
dotenv.config();
@@ -90,4 +91,12 @@ router.post("/setTakeDate/:key/:loan_code", async (req, res) => {
}
});
router.get("/allLoans", async (req, res) => {
const result = await getAllLoansV2();
if (result.success) {
return res.status(200).json(result.data);
}
return res.status(500).json({ message: "Failed to fetch loans" });
});
export default router;