implemented service configuration to API service
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user