EN-99 fix, return company in user data on GET profile
This commit is contained in:
@@ -9,7 +9,7 @@ async function middleware( req, res, next ){
|
||||
}
|
||||
const userID = req.JWT.payload.sub;
|
||||
req.context = {
|
||||
user : await usersModel.findById( userID , { password : 0 , session_token : 0 , session_token_exp : 0 } )
|
||||
user : await usersModel.findById( userID , { password : 0 , session_token : 0 , session_token_exp : 0 } ).populate('company')
|
||||
}
|
||||
req.context.userId = req.context.user.id;
|
||||
req.context.companyId = req.context.user.company || null;
|
||||
|
||||
Reference in New Issue
Block a user