ui: Don't pass account name when in project mode (#3435)

When users try to list instances in project mode from Account > SSHKeyPairs > Key > View Instances, we don't need to include sshkeypairs account name into the API Param. It's redundant and causes error.

Fixes #2895
This commit is contained in:
Anurag Awasthi 2019-07-02 12:51:44 +05:30 committed by Rohit Yadav
parent 2ecd5ec804
commit 14bf2e98f3

View File

@ -750,9 +750,13 @@
if ("sshkeypairs" in args.context) {
$.extend(data, {
domainid: args.context.sshkeypairs[0].domainid,
account: args.context.sshkeypairs[0].account,
keypair: args.context.sshkeypairs[0].name
});
if (!cloudStack.context || !cloudStack.context.projects) {
// In case we are in project mode sshkeypairs provides project account name which
// should not be passed as part of API params. So only extend if NOT in project mode.
$.extend(data, { account: args.context.sshkeypairs[0].account});
}
}
$.ajax({