DEV: Coalesce category ids to numbers (#25598)

Otherwise, if you pass in strings, strange things happen.
This commit is contained in:
Daniel Waterworth 2024-02-07 17:19:58 -06:00 committed by GitHub
parent 6341bfa0b6
commit 3da302716c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View File

@ -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() {

View File

@ -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(