]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
window/Edit: read digest also from top level response
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 15 May 2020 08:19:24 +0000 (10:19 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 18 May 2020 15:03:32 +0000 (17:03 +0200)
we want to have the digest in the top level object, like:
{
    data: { /* the real data */ },
    digest: "fa123asf123123123", // the digest
}

instead of in the data itself, so read it preferably from there
(with fallback to stay compatible)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
window/Edit.js

index d21c1650e4eb009286b4daf26217b7a1050fc36b..6e6c0d4eaf300d88fa221d12bc0dd51961ccdf58 100644 (file)
@@ -192,7 +192,7 @@ Ext.define('Proxmox.window.Edit', {
                method: 'GET',
                success: function(response, opts) {
                    form.clearInvalid();
-                   me.digest = response.result.data.digest;
+                   me.digest = response.result.digest || response.result.data.digest;
                    if (successFn) {
                        successFn(response, opts);
                    } else {