form: integer field: code cleanup in getSubmitData

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-11-07 14:56:49 +01:00
parent 60ed17bf96
commit 8df4bd63d7

View File

@ -11,20 +11,19 @@ Ext.define('Proxmox.form.field.Integer', {
step: 1,
getSubmitData: function() {
let me = this,
data = null,
val;
if (!me.disabled && me.submitValue && !me.isFileUpload()) {
val = me.getSubmitValue();
if (val !== undefined && val !== null && val !== '') {
data = {};
data[me.getName()] = val;
} else if (me.getDeleteEmpty()) {
let me = this;
let data = null;
if (!me.disabled && me.submitValue && !me.isFileUpload()) {
let val = me.getSubmitValue();
if (val !== undefined && val !== null && val !== '') {
data = {};
data.delete = me.getName();
data[me.getName()] = val;
} else if (me.getDeleteEmpty()) {
data = {};
data.delete = me.getName();
}
}
return data;
}
return data;
},
});