mirror of
https://github.com/discourse/discourse.git
synced 2024-12-04 03:23:39 +08:00
DEV: Coalesce category ids to numbers (#25598)
Otherwise, if you pass in strings, strange things happen.
This commit is contained in:
parent
6341bfa0b6
commit
3da302716c
|
@ -18,10 +18,7 @@ export default class CategoryList extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
get categoryIds() {
|
get categoryIds() {
|
||||||
return this.args.value
|
return this.args.value.split("|").filter(Boolean);
|
||||||
.split("|")
|
|
||||||
.map((x) => parseInt(x, 10))
|
|
||||||
.filter(Boolean);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateSelectedCategories() {
|
async updateSelectedCategories() {
|
||||||
|
|
|
@ -482,6 +482,8 @@ Category.reopenClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
async asyncFindByIds(ids = []) {
|
async asyncFindByIds(ids = []) {
|
||||||
|
ids = ids.map((x) => parseInt(x, 10));
|
||||||
|
|
||||||
const result = await categoryMultiCache.fetch(ids);
|
const result = await categoryMultiCache.fetch(ids);
|
||||||
if (categoryMultiCache.hadTooManyCalls()) {
|
if (categoryMultiCache.hadTooManyCalls()) {
|
||||||
warn(
|
warn(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user