Skip to content

Commit bcd547a

Browse files
committed
feat: update runtime retrieval logic to handle empty arrays and improve namespace filtering
1 parent c2073d0 commit bcd547a

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/packages/ce/src/runtime/services/Runtime.service.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,11 @@ export class RuntimeService extends ReactiveArrayService<Runtime, RuntimeDepende
4444
return this.values().find(runtime => runtime && runtime.id === id);
4545
}
4646

47-
//TODO: rework to be able to get all runtimes that you can access. If no namespace id is provided just get the global runtiimes
48-
// TODO: if namespace id is provided get the runtimes for this namespace and also the global runtimes
4947
values(dependencies?: RuntimeDependencies): Runtime[] {
5048
const runtimes = super.values()
5149

5250
if (!dependencies?.namespaceId) {
53-
if (runtimes.length === 0) {
51+
if (runtimes.length <= 0) {
5452
this.client.query<Query>({
5553
query: globalRuntimesQuery,
5654
variables: {
@@ -73,7 +71,7 @@ export class RuntimeService extends ReactiveArrayService<Runtime, RuntimeDepende
7371
const namespaceId = dependencies.namespaceId
7472
const filtered = runtimes.filter(r => r.namespace?.id === namespaceId)
7573

76-
if (filtered.length === 0) {
74+
if (filtered.length <= 0) {
7775
this.client.query<Query>({
7876
query: namespaceRuntimesQuery,
7977
variables: {

0 commit comments

Comments
 (0)