mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 01:22:36 +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() {
|
||||
return this.args.value
|
||||
.split("|")
|
||||
.map((x) => parseInt(x, 10))
|
||||
.filter(Boolean);
|
||||
return this.args.value.split("|").filter(Boolean);
|
||||
}
|
||||
|
||||
async updateSelectedCategories() {
|
||||
|
|
|
@ -482,6 +482,8 @@ Category.reopenClass({
|
|||
},
|
||||
|
||||
async asyncFindByIds(ids = []) {
|
||||
ids = ids.map((x) => parseInt(x, 10));
|
||||
|
||||
const result = await categoryMultiCache.fetch(ids);
|
||||
if (categoryMultiCache.hadTooManyCalls()) {
|
||||
warn(
|
||||
|
|
Loading…
Reference in New Issue
Block a user