Sort results with no matches last

This commit is contained in:
Jonathan Cremin 2014-12-04 19:30:29 +00:00
parent 2b65c0632a
commit fd991668af

View file

@ -35,6 +35,11 @@ router.get('/:service/:type/:id', function(req, res) {
return result.value;
}
});
items.sort(function(a, b) {
return !a.id || !b.id;
})
items.unshift(item);
res.render(type, {items: items});