FIX: Assign default value for category.findByIds method

This commit is contained in:
Vinoth Kannan 2018-11-22 12:51:04 +05:30
parent 672e95bcb4
commit 036790d13c
2 changed files with 3 additions and 1 deletions

View File

@ -257,7 +257,7 @@ Category.reopenClass({
return Category.idMap()[id];
},
findByIds(ids) {
findByIds(ids = []) {
const categories = [];
ids.forEach(id => {
const found = Category.findById(id);

View File

@ -196,6 +196,8 @@ QUnit.test("findByIds", assert => {
Discourse.Category.findByIds([1, 2, 3]),
_.values(categories)
);
assert.deepEqual(Discourse.Category.findByIds(), []);
});
QUnit.test("search with category name", assert => {