| | |
| | | |
| | | fastify |
| | | /////// USER //////////////////////////////////////////////////////////////// |
| | | .get('/api/users', async function (req, res) { |
| | | .get('/api/user', async function (req, res) { |
| | | const {offset, limit, search} = req.query |
| | | const users = await db.getUsers(offset, limit, search) |
| | | return res.send(users) |
| | | }) |
| | | .get("/api/users/count", async function (req, res) { |
| | | .get("/api/user/count", async function (req, res) { |
| | | const count = await db.getUserCount() |
| | | return res.send(count) |
| | | }) |
| | |
| | | } |
| | | }) |
| | | |
| | | |
| | | .delete("/api/user", async function (req, res) { // DELETE ALL users |
| | | const res2 = await libIlias.deleteAllUsers() |
| | | return res.send(res2) |
| | | }) |
| | | .delete("/api/user/:usr_id", async function (req, res) { |
| | | const {usr_id} = req.params |
| | | if (!usr_id || isNaN(Number(usr_id))) { |
| | |
| | | console.log(res2) |
| | | return res.send(res2) |
| | | } |
| | | |
| | | }) |
| | | |
| | | /////// ref_id / obj_id //////////////////////////////////////////////////////////////// |