mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-16 17:25:58 +00:00
Fix create and delete database (#317)
This commit is contained in:
parent
79dec6a8a8
commit
a133134b8b
@ -296,12 +296,16 @@ export default class AddDatabasePane extends ContextualPaneBase {
|
|||||||
this.isExecuting(true);
|
this.isExecuting(true);
|
||||||
|
|
||||||
const createDatabaseParams: DataModels.CreateDatabaseParams = {
|
const createDatabaseParams: DataModels.CreateDatabaseParams = {
|
||||||
autoPilotMaxThroughput: this.maxAutoPilotThroughputSet(),
|
|
||||||
databaseId: addDatabasePaneStartMessage.database.id,
|
databaseId: addDatabasePaneStartMessage.database.id,
|
||||||
databaseLevelThroughput: addDatabasePaneStartMessage.database.shared,
|
databaseLevelThroughput: addDatabasePaneStartMessage.database.shared
|
||||||
offerThroughput: addDatabasePaneStartMessage.offerThroughput
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (this.isAutoPilotSelected()) {
|
||||||
|
createDatabaseParams.autoPilotMaxThroughput = this.maxAutoPilotThroughputSet();
|
||||||
|
} else {
|
||||||
|
createDatabaseParams.offerThroughput = addDatabasePaneStartMessage.offerThroughput;
|
||||||
|
}
|
||||||
|
|
||||||
createDatabase(createDatabaseParams).then(
|
createDatabase(createDatabaseParams).then(
|
||||||
(database: DataModels.Database) => {
|
(database: DataModels.Database) => {
|
||||||
this._onCreateDatabaseSuccess(offerThroughput, startKey);
|
this._onCreateDatabaseSuccess(offerThroughput, startKey);
|
||||||
|
@ -93,6 +93,10 @@ async function getOperationStatus(operationStatusUrl: string) {
|
|||||||
throw new AbortError(error);
|
throw new AbortError(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (response.status === 204) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const body = await response.json();
|
const body = await response.json();
|
||||||
const status = body.status;
|
const status = body.status;
|
||||||
if (!status && response.status === 200) {
|
if (!status && response.status === 200) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user