From 018682c0d8799dad0890cae5877092a328a235c5 Mon Sep 17 00:00:00 2001
From: alex <alex@alexloehr.net>
Date: Wed, 04 Jun 2025 16:41:55 +0000
Subject: [PATCH] adding user teilnahmen

---
 app.js |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/app.js b/app.js
index f512971..9110702 100644
--- a/app.js
+++ b/app.js
@@ -65,6 +65,19 @@
          return res.code(404).send({status: "error", msg: "not found"})
       }
    })
+   .get("/api/user/teilnahmen/:userId", async function (req, res) {
+      const {userid} = req.params
+      if(!userid || isNaN(Number(userid))) {
+         return res.code(500).send({status: "error", msg: "userid error"})
+      }
+      const tn = await db.getUserTeilnahmen(userid)
+      if (tn) {
+         return res.send(tn)
+      }
+      else {
+         return res.code(404).send({status: "error", msg: "not found"})
+      }
+   })
 
    /////// ref_id / obj_id  ////////////////////////////////////////////////////////////////
 

--
Gitblit v1.8.0