FIX: Assign default value for category.findByIds method
This commit is contained in:
parent
672e95bcb4
commit
036790d13c
|
@ -257,7 +257,7 @@ Category.reopenClass({
|
|||
return Category.idMap()[id];
|
||||
},
|
||||
|
||||
findByIds(ids) {
|
||||
findByIds(ids = []) {
|
||||
const categories = [];
|
||||
ids.forEach(id => {
|
||||
const found = Category.findById(id);
|
||||
|
|
|
@ -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 => {
|
||||
|
|
Loading…
Reference in New Issue