bernardodemarco commented on code in PR #13896:
URL: https://github.com/apache/cloudstack/pull/13896#discussion_r3803798401


##########
ui/src/components/view/ApiKeyPairsTab.vue:
##########
@@ -287,34 +287,17 @@ export default {
       this.fetchLoading = true
       try {
         await Promise.all(keypairs.map(async keypair => {
-          try {
-            const jobId = await this.deleteKeyPair({
-              keypairid: keypair.id
-            })
-            await this.$pollJob({
-              jobId,
-              action: {
-                isFetchData: false
-              },
-              successMethod: () => {
-                eventBus.emit('update-resource-state', { selectedItems: 
this.selectedItems, resource: keypair.id, state: 'success' })
-              },
-              catchMethod: () => {
-                eventBus.emit('update-resource-state', { selectedItems: 
this.selectedItems, resource: keypair.id, state: 'failed' })
-              }
-            })
-          } catch (e) {
+          await postAPI('deleteUserKeys', { keypairid: keypair.id 
}).then(response => {
+            eventBus.emit('update-resource-state', { selectedItems: 
this.selectedItems, resource: keypair.id, state: 'success' })
+          }).catch(error => {
             eventBus.emit('update-resource-state', { selectedItems: 
this.selectedItems, resource: keypair.id, state: 'failed' })
-          }
+            this.$notifyError(error)

Review Comment:
   @winterhazel ok, great!
   
   @weizhouapache @winterhazel we can merge it as it is!!!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to