diff --git a/addons/api/mirage/config.js b/addons/api/mirage/config.js index 8a42d9662..25be61159 100644 --- a/addons/api/mirage/config.js +++ b/addons/api/mirage/config.js @@ -706,7 +706,18 @@ function routes() { ); // session recordings - this.get('/session-recordings'); + this.get( + '/session-recordings', + ( + { sessionRecordings }, + { queryParams: { scope_id: scopeId, recursive } } + ) => { + if (recursive && scopeId === 'global') { + return sessionRecordings.all(); + } + return sessionRecordings.where({ scopeId }); + } + ); this.get( '/session-recordings/:idMethod', async ({ sessionRecordings }, { params: { idMethod } }) => { diff --git a/ui/admin/app/routes/scopes/scope/session-recordings.js b/ui/admin/app/routes/scopes/scope/session-recordings.js index 9b121c822..e18a61020 100644 --- a/ui/admin/app/routes/scopes/scope/session-recordings.js +++ b/ui/admin/app/routes/scopes/scope/session-recordings.js @@ -26,7 +26,11 @@ export default class ScopesScopeSessionRecordingsRoute extends Route { const scope = this.modelFor('scopes.scope'); // if (this.can.can('list session-recording', scope, { collection: 'session-recordings' })) { const { id: scope_id } = scope; - const sessionRecordings = await this.store.findAll('session-recording'); + + const sessionRecordings = await this.store.query('session-recording', { + scope_id, + recursive: true, + }); const storageBuckets = await this.store.query('storage-bucket', { scope_id, recursive: true,