From e11dc9345a753d43e8ab92638fad392ec546b8bb Mon Sep 17 00:00:00 2001
From: alex <alex@alexloehr.net>
Date: Sun, 15 Jun 2025 09:56:43 +0000
Subject: [PATCH] GS-2160

---
 app.js |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/app.js b/app.js
index 92b42ee..97f095d 100644
--- a/app.js
+++ b/app.js
@@ -6,6 +6,7 @@
 const fs = require("node:fs")
 
 const db = require("./lib/db")
+const libIlias = require("lib/libIlias")
 const settings = require("./settings")
 const search = require("./lib/search.js")
 
@@ -98,6 +99,19 @@
       }
    })
 
+   .delete("/api/user/:usr_id", function (req, res) {
+      const {usr_id} = req.params
+      if (!usr_id || isNaN(Number(usr_id))) {
+         return res.code(500).send({status: "error", msg: "userId error"})
+      }
+      else {
+         const res2 = libIlias.deleteUser(usr_id)
+         console.log(res2)
+         return res.send(res2)
+      }
+
+   })
+
    /////// ref_id / obj_id  ////////////////////////////////////////////////////////////////
 
    .get("/api/ref_id/:ref_id", async function (req, res) {
@@ -174,7 +188,7 @@
    })
 
 
-/////// STATIC ////////////////////////////////////////////////////////////////
+/////// STATIC / SPA ////////////////////////////////////////////////////////////////
 
 
 fastify.register(require('@fastify/static'), {
@@ -183,13 +197,6 @@
 
    // constraints: { host: 'example.com' } // optional: default {}
 })
-
-
-// fastify.get('*', function (req, reply) {
-//    console.log("!!!!!!!!! send index")
-//    // index.html should never be cached
-//    reply.sendFile('dist/index.html', {maxAge: 0, immutable: false})
-// })
 
 const indexFile = fs.readFileSync(path.join(__dirname, "vue/dist", 'index.html'), 'utf8')
 fastify.setNotFoundHandler(function (req, res) {

--
Gitblit v1.8.0