1
0
mirror of synced 2025-10-29 10:29:18 +00:00

admin dashboard, database updated (members, groups), group setup and permissions

This commit is contained in:
Valentin PUCCETTI
2023-09-10 20:52:09 +02:00
parent 14dad1f5f1
commit a3b8a865fd
21 changed files with 723 additions and 34 deletions

21
services/users.service.js Normal file
View File

@@ -0,0 +1,21 @@
const User = require('../model/user.model')
async function userList(code) {
return await User.findAll()
}
function makeAdmin(userId) {
User.findOne({ where: { id: userId } }).then((result) => {
if (result) {
result.admin = true;
result.save().then(() => {
console.log('user ' + result.login + ' is now admin')
});
}
});
}
module.exports = {
userList,
makeAdmin
};