admin could add user, fix #14

This commit is contained in:
lesion
2019-06-18 14:45:04 +02:00
parent f77e6b1ed6
commit 85694906f1
9 changed files with 83 additions and 46 deletions

View File

@@ -217,6 +217,7 @@ const userController = {
}
},
async register(req, res) {
const n_users = await User.count()
try {
@@ -243,6 +244,16 @@ const userController = {
} catch (e) {
res.status(404).json(e)
}
},
async create(req, res) {
try {
req.body.is_active = true
const user = await User.create(req.body)
res.json(user)
} catch (e) {
res.status(404).json(e)
}
}
}