- Added add user methods (will need polish imo)

This commit is contained in:
Alexis
2020-07-03 21:44:01 +02:00
parent 3f82b487dc
commit e6f0ee38aa
3 changed files with 51 additions and 22 deletions

View File

@@ -39,15 +39,15 @@ router.get('/', async (req, res) => {
// GET ONE FORM UUID ------------------
const getUserFromUUID = (uuid) => {
return Users.getOneFromUUID(uuid)
const getUserByUUID = (uuid) => {
return Users.getOneByUUID(uuid)
.catch(err => {
console.log(err)
throw err
})
}
router.get('/:uuid/', async (req, res) => {
getUserFromUUID(req.params.uuid)
getUserByUUID(req.params.uuid)
.then(v => {
res.setHeader('Content-Type', 'application/json;charset=utf-8')
res.end(JSON.stringify(v))
@@ -67,7 +67,6 @@ router.get('/:uuid/', async (req, res) => {
const addUser = (u) => {
return Users.addOne(u)
.catch(err => {
console.log(err)
throw err
})
}