Fix create database for serverless accounts (#228)

This commit is contained in:
victor-meng
2020-09-24 14:03:37 -07:00
committed by GitHub
parent 290ca4aba5
commit 2e747a1a07
6 changed files with 8 additions and 14 deletions

View File

@@ -666,7 +666,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
const subscriptionType: ViewModels.SubscriptionType =
this.container.subscriptionType && this.container.subscriptionType();
if (subscriptionType === ViewModels.SubscriptionType.EA) {
if (subscriptionType === ViewModels.SubscriptionType.EA || this.container.isServerlessEnabled()) {
return false;
}

View File

@@ -337,7 +337,7 @@ export default class AddDatabasePane extends ContextualPaneBase {
const subscriptionType: ViewModels.SubscriptionType =
this.container.subscriptionType && this.container.subscriptionType();
if (subscriptionType === ViewModels.SubscriptionType.EA) {
if (subscriptionType === ViewModels.SubscriptionType.EA || this.container.isServerlessEnabled()) {
return false;
}

View File

@@ -200,11 +200,10 @@ export default class Database implements ViewModels.Database {
}
public async loadOffer(): Promise<void> {
if (!this.offer()) {
if (!this.container.isServerlessEnabled() && !this.offer()) {
const params: DataModels.ReadDatabaseOfferParams = {
databaseId: this.id(),
databaseResourceId: this.self,
isServerless: this.container.isServerlessEnabled()
databaseResourceId: this.self
};
this.offer(await readDatabaseOffer(params));
}