fixed global visibility query
This commit is contained in:
parent
1ab316c774
commit
dbfe62df6a
|
@ -180,6 +180,7 @@ router.get('/', auth.optional, function(req, res, next) {
|
|||
.skip(Number(offset))
|
||||
.sort({createdAt: 'desc'})
|
||||
.populate('author')
|
||||
.where('visibleForAll || author == user')
|
||||
.exec(),
|
||||
Track.countDocuments(query).exec(),
|
||||
req.payload ? User.findById(req.payload.id) : null,
|
||||
|
|
|
@ -32,7 +32,7 @@ router.put('/user', auth.required, function(req, res, next){
|
|||
if(typeof req.body.user.areTracksVisibleForAll !== 'undefined'){
|
||||
user.areTracksVisibleForAll = req.body.user.areTracksVisibleForAll;
|
||||
}
|
||||
if(typeof req.body.user.password !== 'undefined'){
|
||||
if(typeof req.body.user.password !== 'undefined' && req.body.user.password !='' ){
|
||||
user.setPassword(req.body.user.password);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue