Chore include terminated (#1126)
* chore: 🤖 add include_terminated=true when filtering terminated * chore: 🤖 add include_terminated=true when filtering terminated
This commit is contained in:
1 parent
24f630f084
commit
dc78fe9028
2 files changed
+18
-15
No files matched your search
@@ -48,11 +48,15 @@ export default class ScopesScopeSessionsRoute extends Route {
|
||||
*/
|
||||
async model() {
|
||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
||||
const { status } = this;
|
||||
const filters = { status: this.status };
|
||||
const options = {
|
||||
scope_id,
|
||||
include_terminated: filters.status?.includes('terminated'),
|
||||
};
|
||||
const sessions = await this.resourceFilterStore.queryBy(
|
||||
'session',
|
||||
{ status },
|
||||
{ scope_id }
|
||||
filters,
|
||||
options
|
||||
);
|
||||
|
||||
const sessionAggregates = await all(
|
||||
|
||||
@@ -50,19 +50,18 @@ export default class ScopesScopeProjectsSessionsRoute extends Route {
|
||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
||||
const { user_id } = this.session.data.authenticated;
|
||||
const projects = this.project || [];
|
||||
const filters = {
|
||||
user_id,
|
||||
status,
|
||||
scope_id: projects.map(({ id }) => id),
|
||||
};
|
||||
const options = {
|
||||
recursive: true,
|
||||
scope_id,
|
||||
include_terminated: filters.status?.includes('terminated'),
|
||||
};
|
||||
await this.store.query('target', { recursive: true, scope_id });
|
||||
return await this.resourceFilterStore.queryBy(
|
||||
'session',
|
||||
{
|
||||
user_id,
|
||||
status,
|
||||
scope_id: projects.map(({ id }) => id),
|
||||
},
|
||||
{
|
||||
recursive: true,
|
||||
scope_id,
|
||||
}
|
||||
);
|
||||
return await this.resourceFilterStore.queryBy('session', filters, options);
|
||||
}
|
||||
|
||||
@runEvery(POLL_TIMEOUT_SECONDS * 1000)
|
||||
|
||||
Reference in new issue
Block a user