weizhouapache commented on code in PR #13896:
URL: https://github.com/apache/cloudstack/pull/13896#discussion_r3803694510
##########
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:
cc @winterhazel
shall we merge 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]