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

endpoint/update with secret & co

This commit is contained in:
Valentin PUCCETTI
2023-09-11 22:21:34 +02:00
parent 6ad785f480
commit 7c6c82f47b
12 changed files with 107 additions and 22 deletions

View File

@@ -3,12 +3,8 @@ const User = require('../model/user.model')
const regexp_space = /^\S*$/;
async function userList(code) {
return await User.findAll()
}
function makeAdmin(userId) {
User.findOne({ where: { id: userId } }).then((result) => {
function makeAdmin(login) {
User.findOne({ where: { login: login } }).then((result) => {
if (result) {
result.admin = true;
result.save().then(() => {