Skip to content

Commit d9c99ca

Browse files
committed
fix(ui): error if no workspaces in template
1 parent abf55ab commit d9c99ca

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

web/src/views/project/template/TemplateTerraformState.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,10 @@ export default {
423423
},
424424
425425
async loadStates() {
426+
if (!this.inventoryId) {
427+
this.states = [];
428+
return;
429+
}
426430
this.states = (await axios.get(`/api/project/${this.template.project_id}/inventory/${this.inventoryId}/terraform/states`)).data;
427431
},
428432
@@ -441,6 +445,10 @@ export default {
441445
},
442446
443447
async loadAliases() {
448+
if (!this.inventoryId) {
449+
this.aliases = [];
450+
return;
451+
}
444452
try {
445453
this.aliases = (await axios({
446454
url: `/api/project/${this.template.project_id}/inventory/${this.inventoryId}/terraform/aliases`,

0 commit comments

Comments
 (0)