Copilot commented on code in PR #14215:
URL: https://github.com/apache/cloudstack/pull/14215#discussion_r4065124857


##########
ui/src/views/compute/wizard/OwnershipSelection.vue:
##########
@@ -231,6 +234,14 @@ export default {
           this.initialized = true
         })
     },
+    handleSelectedAccountId (accountName) {
+      const selected = this.accounts.find(acc => acc.name === accountName)
+      if (selected) {
+        this.selectedAccount = selected.name
+        this.selectedAccountId = selected.id
+      }
+      this.emitChangeEvent()

Review Comment:
   When the selected account name has no matching entry (for example, after 
switching to a domain with no accounts or while the account request is being 
reset), this handler leaves the previous `selectedAccountId` intact. 
`AssignVolume` consumes that ID and can submit an assignment to the stale 
account even though the UI has no valid account selected. Clear 
`selectedAccountId` in the no-match branch before emitting the owner change.



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