weizhouapache commented on code in PR #9708:
URL: https://github.com/apache/cloudstack/pull/9708#discussion_r1766684572


##########
ui/src/views/network/NicsTab.vue:
##########
@@ -368,9 +376,26 @@ export default {
         this.$pollJob({
           jobId: response.addnictovirtualmachineresponse.jobid,
           successMessage: this.$t('message.success.add.network'),
-          successMethod: () => {
-            this.loadingNic = false
-            this.closeModals()
+          successMethod: async () => {
+            if (this.addNetworkData.makedefault) {
+              try {
+                this.nic = await this.getNic(params.networkid, 
params.virtualmachineid)
+                if (this.nic) {
+                  this.setAsDefault(this.nic)
+                } else {
+                  this.$notifyError('NIC data not found.')
+                  this.loadingNic = false
+                  this.closeModals()
+                }
+              } catch (error) {
+                this.$notifyError('Failed to fetch NIC data.')
+                this.loadingNic = false
+                this.closeModals()
+              }
+            } else {
+              this.loadingNic = false

Review Comment:
   @abh1sar 
   the changes in your last commit 
https://github.com/apache/cloudstack/pull/9708/commits/02be6a2e48e906d5256ab683747d62709bb73a52
 is exactly what I meant. 



-- 
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