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:
xusongfu 2022-09-21 16:24:19 +08:00
parent 06af9d6fd3
commit f20b28c64e

View File

@ -116,6 +116,7 @@ export class FlavorStore extends Base {
async create(data, extraSpecs, accessControl) {
const body = {};
body[this.responseKey] = data;
try {
this.isSubmitting = true;
const result = await this.client.create(body);
const { id } = result.flavor;
@ -135,6 +136,10 @@ export class FlavorStore extends Base {
);
}
return this.submitting(this.client.extraSpecs.create(id, extraBody));
} catch (error) {
this.isSubmitting = false;
return Promise.reject(error);
}
}
@action