From bd6b930043d6bca90b6a3be7a4a18c9da713555d Mon Sep 17 00:00:00 2001
From: alex <alex@alexloehr.net>
Date: Mon, 30 Jun 2025 14:21:26 +0000
Subject: [PATCH] update settings

---
 app.js |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/app.js b/app.js
index 3928423..d4cc17b 100644
--- a/app.js
+++ b/app.js
@@ -29,7 +29,7 @@
       return res.send({status: "error", error: "access denied"})
    }
    else {
-      console.log("NO AUTH FOR ", req.url)
+      console.log("AUTH FOR ", req.url)
    }
 })
 
@@ -109,6 +109,11 @@
       }
    })
 
+   .post("/api/user", async function (req, res) {
+      const user = req.body
+      const res2 = await libIlias.importIliasUser(user) // TODO import or update if already available
+      return res.send(res2)
+   })
 
    .delete("/api/user", async function (req, res) { // DELETE ALL users
       const res2 = await libIlias.deleteAllUsers()
@@ -205,7 +210,9 @@
       const {refId, usrId} = req.params
       if (!refId || !usrId) throw {status: "error", msg: "refId and usrId requried"}
       try {
-         let data = await libIlias.deleteTeilnahme(refId, usrId)
+         const {obj_id: course_id} = await db.getObjIdFromRefId(refId)
+         let data = await libIlias.abmelden(usrId, course_id)
+         // let data = await libIlias.deleteTeilnahme(refId, usrId)
          if (!data) throw {statusCode: 404, message: "Teilnahme not found"}
          return res.send(data)
       } catch (ex) {

--
Gitblit v1.8.0