fix: The loading cannot be canceled
The loading state cannot be canceled when create a flavor with a existing name Closes-Bug: #1990362 Change-Id: I409024fe9a47103e9e6401d408b739d0365bd621
This commit is contained in:
parent
06af9d6fd3
commit
f20b28c64e
@ -116,25 +116,30 @@ export class FlavorStore extends Base {
|
|||||||
async create(data, extraSpecs, accessControl) {
|
async create(data, extraSpecs, accessControl) {
|
||||||
const body = {};
|
const body = {};
|
||||||
body[this.responseKey] = data;
|
body[this.responseKey] = data;
|
||||||
this.isSubmitting = true;
|
try {
|
||||||
const result = await this.client.create(body);
|
this.isSubmitting = true;
|
||||||
const { id } = result.flavor;
|
const result = await this.client.create(body);
|
||||||
const extraBody = {
|
const { id } = result.flavor;
|
||||||
extra_specs: extraSpecs,
|
const extraBody = {
|
||||||
};
|
extra_specs: extraSpecs,
|
||||||
if (accessControl && accessControl.length > 0) {
|
};
|
||||||
await Promise.all(
|
if (accessControl && accessControl.length > 0) {
|
||||||
accessControl.map((it) => {
|
await Promise.all(
|
||||||
const accessBody = {
|
accessControl.map((it) => {
|
||||||
addTenantAccess: {
|
const accessBody = {
|
||||||
tenant: it,
|
addTenantAccess: {
|
||||||
},
|
tenant: it,
|
||||||
};
|
},
|
||||||
return this.client.action(id, accessBody);
|
};
|
||||||
})
|
return this.client.action(id, accessBody);
|
||||||
);
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return this.submitting(this.client.extraSpecs.create(id, extraBody));
|
||||||
|
} catch (error) {
|
||||||
|
this.isSubmitting = false;
|
||||||
|
return Promise.reject(error);
|
||||||
}
|
}
|
||||||
return this.submitting(this.client.extraSpecs.create(id, extraBody));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
Loading…
Reference in New Issue
Block a user