DEV: Do lazy_load_categories check inside asyncFindByIds (#25600)

This way, we can use asyncFindByIds indiscriminately.
This commit is contained in:
Daniel Waterworth 2024-02-07 17:33:59 -06:00 committed by GitHub
parent 8058fd5b80
commit 57c53b0ead
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -484,6 +484,10 @@ Category.reopenClass({
async asyncFindByIds(ids = []) {
ids = ids.map((x) => parseInt(x, 10));
if (!Site.current().lazy_load_categories) {
return this.findByIds(ids);
}
const result = await categoryMultiCache.fetch(ids);
if (categoryMultiCache.hadTooManyCalls()) {
warn(