Merge branch 'dev_v1-admin' into debian12_v1-admin

This commit is contained in:
2025-09-27 23:29:54 +02:00
3 changed files with 113 additions and 218 deletions

View File

@@ -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
router.get("/allLoans/:key", apiKeyGuard, async (req, res) => {
// Route for API to get ALL loans from the database without sensitive info (only for landingpage)
router.get("/allLoans", async (req, res) => {
const result = await getAllLoansV2();
if (result.success) {
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" });
});
// Route for API to get ALL items form the database
router.get("/allItems/:key", apiKeyGuard, async (req, res) => {
// Route for API to get ALL items from the database (only for landingpage)
router.get("/allItems", async (req, res) => {
const result = await getItemsFromDatabaseV2();
if (result.success) {
res.status(200).json(result.data);

View File

@@ -63,8 +63,7 @@ CREATE TABLE `apiKeys` (
`apiKey` int NOT NULL UNIQUE,
`user` VARCHAR(255) NOT NULL,
`entry_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `apiKey` (`apiKey`)
PRIMARY KEY (`id`)
);
INSERT INTO `items` (`item_name`, `can_borrow_role`, `inSafe`) VALUES