implemented service configuration to API service

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-26 14:57:59 +02:00
parent 0964109c4b
commit 747932cf03
2 changed files with 19 additions and 0 deletions
+4
View File
@@ -1,5 +1,6 @@
import express from "express";
import { authenticate } from "../../services/authentication.js";
import { checkIfServiceIsActive } from "../../services/functions.js";
const router = express.Router();
import dotenv from "dotenv";
dotenv.config();
@@ -39,6 +40,7 @@ router.post("/change-state/:key/:itemId", authenticate, async (req, res) => {
router.get(
"/get-loan-by-code/:key/:loan_code",
authenticate,
checkIfServiceIsActive("Loan Service"),
async (req, res) => {
const loan_code = req.params.loan_code;
const result = await getLoanByCodeV2(loan_code);
@@ -54,6 +56,7 @@ router.get(
router.post(
"/set-return-date/:key/:loan_code",
authenticate,
checkIfServiceIsActive("Loan Service"),
async (req, res) => {
const loanCode = req.params.loan_code;
const result = await setReturnDateV2(loanCode);
@@ -69,6 +72,7 @@ router.post(
router.post(
"/set-take-date/:key/:loan_code",
authenticate,
checkIfServiceIsActive("Loan Service"),
async (req, res) => {
const loanCode = req.params.loan_code;
const result = await setTakeDateV2(loanCode);