mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 09:20:16 +00:00
Fix throughputcap check (#1156)
This commit is contained in:
@@ -18,6 +18,7 @@ interface DatabasesState {
|
||||
findCollection: (databaseId: string, collectionId: string) => ViewModels.Collection;
|
||||
isLastCollection: () => boolean;
|
||||
loadDatabaseOffers: () => Promise<void>;
|
||||
loadAllOffers: () => Promise<void>;
|
||||
isFirstResourceCreated: () => boolean;
|
||||
findSelectedDatabase: () => ViewModels.Database;
|
||||
validateDatabaseId: (id: string) => boolean;
|
||||
@@ -97,6 +98,19 @@ export const useDatabases: UseStore<DatabasesState> = create((set, get) => ({
|
||||
})
|
||||
);
|
||||
},
|
||||
loadAllOffers: async () => {
|
||||
await Promise.all(
|
||||
get().databases?.map(async (database: ViewModels.Database) => {
|
||||
await database.loadOffer();
|
||||
await database.loadCollections();
|
||||
await Promise.all(
|
||||
(database.collections() || []).map(async (collection: ViewModels.Collection) => {
|
||||
await collection.loadOffer();
|
||||
})
|
||||
);
|
||||
})
|
||||
);
|
||||
},
|
||||
isFirstResourceCreated: () => {
|
||||
const databases = get().databases;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user