Fix create and delete database (#317)

This commit is contained in:
victor-meng 2020-11-09 15:22:51 -08:00 committed by GitHub
parent 79dec6a8a8
commit a133134b8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View File

@ -296,12 +296,16 @@ export default class AddDatabasePane extends ContextualPaneBase {
this.isExecuting(true);
const createDatabaseParams: DataModels.CreateDatabaseParams = {
autoPilotMaxThroughput: this.maxAutoPilotThroughputSet(),
databaseId: addDatabasePaneStartMessage.database.id,
databaseLevelThroughput: addDatabasePaneStartMessage.database.shared,
offerThroughput: addDatabasePaneStartMessage.offerThroughput
databaseLevelThroughput: addDatabasePaneStartMessage.database.shared
};
if (this.isAutoPilotSelected()) {
createDatabaseParams.autoPilotMaxThroughput = this.maxAutoPilotThroughputSet();
} else {
createDatabaseParams.offerThroughput = addDatabasePaneStartMessage.offerThroughput;
}
createDatabase(createDatabaseParams).then(
(database: DataModels.Database) => {
this._onCreateDatabaseSuccess(offerThroughput, startKey);

View File

@ -93,6 +93,10 @@ async function getOperationStatus(operationStatusUrl: string) {
throw new AbortError(error);
}
if (response.status === 204) {
return;
}
const body = await response.json();
const status = body.status;
if (!status && response.status === 200) {