admin could remove user

This commit is contained in:
lesion
2019-06-18 15:13:13 +02:00
parent 85694906f1
commit 4c3c7ee324
4 changed files with 54 additions and 6 deletions

View File

@@ -254,6 +254,16 @@ const userController = {
} catch (e) {
res.status(404).json(e)
}
},
async remove(req, res) {
try {
const user = await User.findByPk(req.params.id)
user.destroy()
res.sendStatus(200)
} catch (e) {
res.status(404).json(e)
}
}
}