Skip to content

Commit 70cc55d

Browse files
committed
Replace leftover api calls to getAPI calls
1 parent d58d605 commit 70cc55d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

ui/src/components/view/ImageDeployInstanceButton.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</template>
4242

4343
<script>
44-
import { api } from '@/api'
44+
import { getAPI } from '@/api'
4545
import ResourceIcon from '@/components/view/ResourceIcon'
4646
4747
export default {
@@ -100,7 +100,7 @@ export default {
100100
this.itemCount = 0
101101
this.fetchLoading = true
102102
this.zones = []
103-
api(this.imageApi, params).then(json => {
103+
getAPI(this.imageApi, params).then(json => {
104104
const imageResponse = json?.[this.imageApi.toLowerCase() + 'response']?.[this.$route.meta.name] || []
105105
this.zones = imageResponse.map(i => ({
106106
id: i.zoneid,
@@ -122,7 +122,7 @@ export default {
122122
}
123123
const zoneids = this.zones.map(z => z.id)
124124
this.loading = true
125-
api('listZones', { showicon: true, ids: zoneids.join(',') }).then(json => {
125+
getAPI('listZones', { showicon: true, ids: zoneids.join(',') }).then(json => {
126126
this.zones = json.listzonesresponse.zone || []
127127
}).finally(() => {
128128
this.loading = false

ui/src/views/compute/KubernetesAddNodes.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666

6767
<script>
6868
import { ref, reactive, toRaw } from 'vue'
69-
import { api } from '@/api'
69+
import { getAPI } from '@/api'
7070
import TooltipLabel from '@/components/widgets/TooltipLabel'
7171
7272
export default {
@@ -112,7 +112,7 @@ export default {
112112
callListVms (accountId, domainId) {
113113
return new Promise((resolve) => {
114114
this.volumes = []
115-
api('listVirtualMachines', {
115+
getAPI('listVirtualMachines', {
116116
accountId: accountId,
117117
domainId: domainId,
118118
details: 'min',
@@ -172,7 +172,7 @@ export default {
172172
},
173173
addNodesToKubernetesCluster (params) {
174174
return new Promise((resolve, reject) => {
175-
api('addNodesToKubernetesCluster', params).then(json => {
175+
getAPI('addNodesToKubernetesCluster', params).then(json => {
176176
const jobId = json.addnodestokubernetesclusterresponse.jobid
177177
return resolve(jobId)
178178
}).catch(error => {

ui/src/views/compute/KubernetesRemoveNodes.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
<script>
5656
import { ref, reactive, toRaw } from 'vue'
57-
import { api } from '@/api'
57+
import { getAPI } from '@/api'
5858
import TooltipLabel from '@/components/widgets/TooltipLabel'
5959
6060
export default {
@@ -137,7 +137,7 @@ export default {
137137
},
138138
removeNodesFromKubernetesCluster (params) {
139139
return new Promise((resolve, reject) => {
140-
api('removeNodesFromKubernetesCluster', params).then(json => {
140+
getAPI('removeNodesFromKubernetesCluster', params).then(json => {
141141
const jobId = json.removenodesfromkubernetesclusterresponse.jobid
142142
return resolve(jobId)
143143
}).catch(error => {

0 commit comments

Comments
 (0)