CB-3651 fix: container resource key validation (#1956)

Co-authored-by: EvgeniaBzzz <139753579+EvgeniaBzzz@users.noreply.github.com>
This commit is contained in:
Alexey
2023-08-25 18:50:47 +03:00
committed by GitHub
co-authored by EvgeniaBzzz
parent 8d8ac0b5df
commit b2d7f12a11
2 changed files with 4 additions and 2 deletions
@@ -17,6 +17,7 @@ import {
resourceKeyList,
ResourceKeyUtils,
} from '@cloudbeaver/core-sdk';
import { isNull } from '@cloudbeaver/core-utils';
import { ConnectionInfoActiveProjectKey, ConnectionInfoResource } from './ConnectionInfoResource';
import type { IConnectionInfoParams } from './IConnectionsResource';
@@ -124,7 +125,7 @@ export class ContainerResource extends CachedMapResource<ObjectContainerParams,
typeof key === 'object' &&
typeof key.projectId === 'string' &&
['string'].includes(typeof key.connectionId) &&
['string', 'undefined'].includes(typeof key.catalogId)
(['string', 'undefined'].includes(typeof key.catalogId) || isNull(key.catalogId))
);
}
}
+2 -1
View File
@@ -43,8 +43,9 @@ export class TempMap<TKey, TValue> implements Map<TKey, TValue> {
this.entriesTemp = cacheValue();
this.valuesTemp = cacheValue();
makeObservable<this, 'deleted'>(this, {
makeObservable<this, 'deleted' | 'scheduleFlush'>(this, {
deleted: observable.shallow,
scheduleFlush: action,
});
}