added GET /user route
This commit is contained in:
@ -33,13 +33,14 @@ export default class UserValidate { // validate input for user
|
||||
}
|
||||
|
||||
static output (data) { // validate output from database for needed properties, strip everything else
|
||||
return joi.object({
|
||||
const {value, error} = joi.object({
|
||||
_id: joi.any(),
|
||||
name: joi.string(),
|
||||
email: joi.string(),
|
||||
level: joi.string(),
|
||||
location: joi.string(),
|
||||
device_name: joi.string()
|
||||
}).validate(data, {stripUnknown: true}).value;
|
||||
device_name: joi.string().allow('')
|
||||
}).validate(data, {stripUnknown: true})
|
||||
return error !== undefined? null : value;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user