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

View File

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