mirror of
https://github.com/discourse/discourse.git
synced 2025-04-24 04:54:26 +08:00
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];
|
return Category.idMap()[id];
|
||||||
},
|
},
|
||||||
|
|
||||||
findByIds(ids) {
|
findByIds(ids = []) {
|
||||||
const categories = [];
|
const categories = [];
|
||||||
ids.forEach(id => {
|
ids.forEach(id => {
|
||||||
const found = Category.findById(id);
|
const found = Category.findById(id);
|
||||||
|
@ -196,6 +196,8 @@ QUnit.test("findByIds", assert => {
|
|||||||
Discourse.Category.findByIds([1, 2, 3]),
|
Discourse.Category.findByIds([1, 2, 3]),
|
||||||
_.values(categories)
|
_.values(categories)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
assert.deepEqual(Discourse.Category.findByIds(), []);
|
||||||
});
|
});
|
||||||
|
|
||||||
QUnit.test("search with category name", assert => {
|
QUnit.test("search with category name", assert => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user