allow multiple tags

v1.18.x
barisusakli 8 years ago
parent 3f15dbdc54
commit c0a8fd7395

@ -111,8 +111,14 @@ categoryController.get = function (req, res, callback) {
} }
if (req.query.tag) { if (req.query.tag) {
if (Array.isArray(req.query.tag)) {
payload.set = [payload.set].concat(req.query.tag.map(function (tag) {
return 'tag:' + tag + ':topics';
}));
} else {
payload.set = [payload.set, 'tag:' + req.query.tag + ':topics']; payload.set = [payload.set, 'tag:' + req.query.tag + ':topics'];
} }
}
categories.getCategoryById(payload, next); categories.getCategoryById(payload, next);
} }
], next); ], next);

Loading…
Cancel
Save