diff --git a/src/backend/src/filesystem/hl_operations/hl_readdir.js b/src/backend/src/filesystem/hl_operations/hl_readdir.js index 020bb484c..81a57921d 100644 --- a/src/backend/src/filesystem/hl_operations/hl_readdir.js +++ b/src/backend/src/filesystem/hl_operations/hl_readdir.js @@ -39,7 +39,7 @@ class HLReadDir extends HLFilesystemOperation { }); } async __run () { - const { subject: subject_let, user, no_thumbs, no_assocs, actor } = this.values; + const { subject: subject_let, user, no_thumbs, no_assocs, no_subdomains, actor } = this.values; let subject = subject_let; if ( ! await subject.exists() ) { @@ -120,10 +120,11 @@ class HLReadDir extends HLFilesystemOperation { } if ( ! no_assocs ) { - await Promise.all([ - this.#batchFetchSuggestedApps(children, user), - this.#batchFetchSubdomains(children, user), - ]); + await this.#batchFetchSuggestedApps(children, user); + } + + if ( ! no_subdomains ) { + await this.#batchFetchSubdomains(children, user); } return Promise.all(children.map(async child => { diff --git a/src/backend/src/routers/filesystem_api/readdir.js b/src/backend/src/routers/filesystem_api/readdir.js index c3b42dda3..ec235c2ef 100644 --- a/src/backend/src/routers/filesystem_api/readdir.js +++ b/src/backend/src/routers/filesystem_api/readdir.js @@ -42,6 +42,7 @@ module.exports = eggspress('/readdir', { recursive: new FlagParam('recursive', { optional: true }), no_thumbs: new FlagParam('no_thumbs', { optional: true }), no_assocs: new FlagParam('no_assocs', { optional: true }), + no_subdomains: new FlagParam('no_subdomains', { optional: true }), }, }, async (req, res, next) => { let log; { @@ -56,6 +57,7 @@ module.exports = eggspress('/readdir', { const recursive = req.values.recursive; const no_thumbs = req.values.no_thumbs; const no_assocs = req.values.no_assocs; + const no_subdomains = req.values.no_subdomains; const hl_readdir = new HLReadDir(); const result = await hl_readdir.run({ @@ -63,6 +65,7 @@ module.exports = eggspress('/readdir', { recursive, no_thumbs, no_assocs, + no_subdomains, user: req.user, actor: req.actor, });