FIX: If a category can't be found, don't include it in the list

This commit is contained in:
Robin Ward 2014-12-04 13:04:58 -05:00
parent 5492bbe11c
commit 5ec77d4be4

View file

@ -39,9 +39,8 @@ export default function searchForTerm(term, opts) {
});
results.categories = results.categories.map(function(category){
category = Discourse.Category.list().findProperty('id', category.id);
return category;
});
return Discourse.Category.list().findProperty('id', category.id);
}).compact();
var r = results.grouped_search_result;
results.resultTypes = [];