Skip to content

Commit 9372171

Browse files
author
Jessica Wang
committed
CS-16573: cloudstack UI - create volume - encode data passed to API call.
1 parent a96b27b commit 9372171

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

‎ui/scripts/storage.js‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,20 +141,22 @@
141141
},
142142

143143
action: function(args) {
144-
var array1 = [];
145-
array1.push("&name=" + args.data.name);
146-
array1.push("&zoneId=" + args.data.availabilityZone);
147-
array1.push("&diskOfferingId=" + args.data.diskOffering);
148-
144+
var data = {
145+
name: args.data.name,
146+
zoneId: args.data.availabilityZone,
147+
diskOfferingId: args.data.diskOffering
148+
};
149+
149150
// if(thisDialog.find("#size_container").css("display") != "none") { //wait for Brian to include $form in args
150151
if (selectedDiskOfferingObj.iscustomized == true) {
151-
array1.push("&size=" + args.data.diskSize);
152+
$.extend(data, {
153+
size: args.data.diskSize
154+
});
152155
}
153156

154157
$.ajax({
155-
url: createURL("createVolume" + array1.join("")),
156-
dataType: "json",
157-
async: true,
158+
url: createURL('createVolume'),
159+
data: data,
158160
success: function(json) {
159161
var jid = json.createvolumeresponse.jobid;
160162
args.response.success(

0 commit comments

Comments
 (0)