Refactor API routes: remove API key requirement for allLoans and allItems endpoints, update comments for clarity
This commit is contained in:
@@ -111,8 +111,8 @@ router.post("/setTakeDate/:key/:loan_code", apiKeyGuard, async (req, res) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Route for API to get ALL loans from the database without sensitive info
|
// Route for API to get ALL loans from the database without sensitive info (only for landingpage)
|
||||||
router.get("/allLoans/:key", apiKeyGuard, async (req, res) => {
|
router.get("/allLoans", async (req, res) => {
|
||||||
const result = await getAllLoansV2();
|
const result = await getAllLoansV2();
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
return res.status(200).json(result.data);
|
return res.status(200).json(result.data);
|
||||||
@@ -120,8 +120,8 @@ router.get("/allLoans/:key", apiKeyGuard, async (req, res) => {
|
|||||||
return res.status(500).json({ message: "Failed to fetch loans" });
|
return res.status(500).json({ message: "Failed to fetch loans" });
|
||||||
});
|
});
|
||||||
|
|
||||||
// Route for API to get ALL items form the database
|
// Route for API to get ALL items from the database (only for landingpage)
|
||||||
router.get("/allItems/:key", apiKeyGuard, async (req, res) => {
|
router.get("/allItems", async (req, res) => {
|
||||||
const result = await getItemsFromDatabaseV2();
|
const result = await getItemsFromDatabaseV2();
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
res.status(200).json(result.data);
|
res.status(200).json(result.data);
|
||||||
|
Reference in New Issue
Block a user