From 09781ff7ca439b0d24b4757d09e8325b48a9341c Mon Sep 17 00:00:00 2001
From: alex <alex@alexloehr.net>
Date: Mon, 02 Jun 2025 09:35:50 +0000
Subject: [PATCH] adding new Routes for obj_id and ref_id

---
 app.js |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/app.js b/app.js
index c286d4b..402324d 100644
--- a/app.js
+++ b/app.js
@@ -50,6 +50,26 @@
          return res.code(404).send({status: "error", msg: "not found"})
       }
    })
+   .get("/ref_id/:ref_id", async function (req, res) {
+      const {ref_id} = req.params
+      const data = await db.getObjIdFromRefId(ref_id)
+      if (data) {
+         return res.send(data)
+      }
+      else {
+         return res.code(404).send({status: "error", msg: "not found"})
+      }
+   })
+   .get("/obj_id/:obj_id", async function (req, res) {
+      const {obj_id} = req.params
+      let data = await db.getRefIdFromObjId(obj_id)
+      if (data) {
+         return res.send(data)
+      }
+      else {
+         return res.code(404).send({status: "error", msg: "not found"})
+      }
+   })
 
 
 /////////////////////////////////////////////////////////////////////////
@@ -64,6 +84,6 @@
 
 /////////////////////////////////////////////////////////////////////////
 
-async function promiseDelay(ms) {
-    return new Promise(resolve => setTimeout(resolve, ms))
+async function promiseDelay (ms) {
+   return new Promise(resolve => setTimeout(resolve, ms))
 }

--
Gitblit v1.8.0