Handle marker icons

This commit is contained in:
Edin Dazdarevic
2017-04-06 01:11:51 +02:00
parent e3e5b4ac96
commit 6905695958
6 changed files with 150 additions and 28 deletions

View File

@@ -60,6 +60,7 @@ router.get('/search', async (req, res, next) => {
});
}
const and = [];
if (rooms) {
const allRooms = rooms.split(',');
const or = allRooms.map(val => {
@@ -75,9 +76,7 @@ router.get('/search', async (req, res, next) => {
};
});
query = Object.assign(query, {
"$or": or
});
and.push({ "$or": or });
}
if (minSize || maxSize) {
@@ -103,8 +102,12 @@ router.get('/search', async (req, res, next) => {
};
});
and.push({ "$or": or });
}
if (and.length > 0) {
query = Object.assign(query, {
"$or": or
"$and": and
});
}