Update: User.ad add isVisible=true & isActive=true

This commit is contained in:
Yûki VACHOT 2021-12-15 01:35:30 +01:00
parent d94a22e87f
commit fc4abb2546

View file

@ -412,10 +412,10 @@ exports.ad = (req, res) => {
}
let match, pick;
if(interests.length > 0){
match = {$match: {interests: {$in: interests}}};
match = {$match: {isVisible: true, isActive: true, interests: {$in: interests}}};
pick = {$limit: parseInt(quantity, 10)}
} else {
match = {$match: {}};
match = {$match: {isVisible: true, isActive: true}};
pick = {$sample: {size: parseInt(quantity, 10)}};
}