diff --git a/src/Common/MongoProxyClient.ts b/src/Common/MongoProxyClient.ts index f9f5b356d..2945f1288 100644 --- a/src/Common/MongoProxyClient.ts +++ b/src/Common/MongoProxyClient.ts @@ -111,7 +111,7 @@ export function queryDocuments( headers: response.headers, }; } - errorHandling(response, "querying documents", params); + await errorHandling(response, "querying documents", params); return undefined; }); } @@ -153,11 +153,11 @@ export function readDocument( ), }, }) - .then((response) => { + .then(async (response) => { if (response.ok) { return response.json(); } - return errorHandling(response, "reading document", params); + return await errorHandling(response, "reading document", params); }); } @@ -192,11 +192,11 @@ export function createDocument( ...authHeaders(), }, }) - .then((response) => { + .then(async (response) => { if (response.ok) { return response.json(); } - return errorHandling(response, "creating document", params); + return await errorHandling(response, "creating document", params); }); } @@ -238,11 +238,11 @@ export function updateDocument( [CosmosSDKConstants.HttpHeaders.PartitionKey]: JSON.stringify(documentId.partitionKeyHeader()), }, }) - .then((response) => { + .then(async (response) => { if (response.ok) { return response.json(); } - return errorHandling(response, "updating document", params); + return await errorHandling(response, "updating document", params); }); } @@ -278,11 +278,11 @@ export function deleteDocument(databaseId: string, collection: Collection, docum [CosmosSDKConstants.HttpHeaders.PartitionKey]: JSON.stringify(documentId.partitionKeyHeader()), }, }) - .then((response) => { + .then(async (response) => { if (response.ok) { return undefined; } - return errorHandling(response, "deleting document", params); + return await errorHandling(response, "deleting document", params); }); } @@ -325,11 +325,11 @@ export function createMongoCollectionWithProxy( }, } ) - .then((response) => { + .then(async (response) => { if (response.ok) { return response.json(); } - return errorHandling(response, "creating collection", mongoParams); + return await errorHandling(response, "creating collection", mongoParams); }); } diff --git a/src/Explorer/Explorer.tsx b/src/Explorer/Explorer.tsx index 65ec636ee..34709806d 100644 --- a/src/Explorer/Explorer.tsx +++ b/src/Explorer/Explorer.tsx @@ -718,7 +718,7 @@ export default class Explorer { const databasesToLoad = this.databases().length <= Explorer.MaxNbDatabasesToAutoExpand ? this.databases() - : this.databases().filter((db) => db.isDatabaseExpanded()); + : this.databases().filter((db) => db.isDatabaseExpanded() || db.id() === Constants.SavedQueries.DatabaseName); const startKey: number = TelemetryProcessor.traceStart(Action.LoadCollections, { dataExplorerArea: Constants.Areas.ResourceTree,