Sort results with no matches last
This commit is contained in:
parent
2b65c0632a
commit
fd991668af
1 changed files with 5 additions and 0 deletions
|
@ -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});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue