Skip to content

Commit

Permalink
feat: add destroy btn
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeap committed Aug 10, 2023
1 parent 9f07088 commit df99493
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/components/node/NodePlane.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ const exportAndOpenModal = () => {
});
exportData.value = JSON.stringify(exportDataArr);
showModal.value = true;
console.log(exportData.value);
if (btnData.value === 'create') {
axios
.post('/terraform/usertf', exportData.value)
Expand All @@ -145,7 +144,7 @@ const exportAndOpenModal = () => {
axios
.post('/terraform/apply', exportData.value)
.then((res) => {
btnData.value = 'create';
btnData.value = 'destroy';
btnMsg.value = 'tf 실행 완료';
btnType.value = 'success';
btnLoader.value = false;
Expand All @@ -156,6 +155,21 @@ const exportAndOpenModal = () => {
btnLoader.value = false;
console.error(err);
});
} else if (btnData.value === 'destroy') {
axios
.post('/terraform/destroy')
.then((res) => {
btnData.value = 'create';
btnMsg.value = 'tf 삭제 완료';
btnType.value = 'success';
btnLoader.value = false;
})
.catch((err) => {
btnMsg.value = 'tf 삭제 실패';
btnType.value = 'warning';
btnLoader.value = false;
console.error(err);
});
}
};
</script>
Expand Down

0 comments on commit df99493

Please sign in to comment.