Use RP to read databases for all API (#280)
Since I've cleaned up all the places that use `_rid` and `_self` of a database in my previous commit (d525afa142
), we are safe to use RP to read databases for all APIs except Tables.
For Tables API, since RP doesn't support any database level operations, I have to hardcode the read database response. The only property we need in the Tables database is the id which is the string that we display in the resource tree.
This commit is contained in:
parent
9933a4988a
commit
39f7ef331a
|
@ -12,16 +12,14 @@ import { sendNotificationForError } from "./sendNotificationForError";
|
|||
import { userContext } from "../../UserContext";
|
||||
|
||||
export async function readDatabases(): Promise<DataModels.Database[]> {
|
||||
if (userContext.defaultExperience === DefaultAccountExperienceType.Table) {
|
||||
return [{ id: "TablesDB" } as DataModels.Database];
|
||||
}
|
||||
|
||||
let databases: DataModels.Database[];
|
||||
const clearMessage = logConsoleProgress(`Querying databases`);
|
||||
try {
|
||||
if (
|
||||
window.authType === AuthType.AAD &&
|
||||
!userContext.useSDKOperations &&
|
||||
userContext.defaultExperience !== DefaultAccountExperienceType.MongoDB &&
|
||||
userContext.defaultExperience !== DefaultAccountExperienceType.Table &&
|
||||
userContext.defaultExperience !== DefaultAccountExperienceType.Cassandra
|
||||
) {
|
||||
if (window.authType === AuthType.AAD && !userContext.useSDKOperations) {
|
||||
databases = await readDatabasesWithARM();
|
||||
} else {
|
||||
const sdkResponse = await client()
|
||||
|
|
Loading…
Reference in New Issue