erp5_web_monitoring: fix delete opml loop bug
Showing
... | ... | @@ -10,23 +10,20 @@ |
///////////////////////////////////////////////////////////////// | ||
.declareAcquiredMethod("redirect", "redirect") | ||
.declareAcquiredMethod("jio_remove", "jio_remove") | ||
.declareAcquiredMethod("notifySubmitting", "notifySubmitting") | ||
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted') | ||
.declareMethod("render", function (options) { | ||
var gadget = this; | ||
return gadget.notifySubmitting() | ||
.push(function () { | ||
return gadget.jio_remove(options.jio_key); | ||
}) | ||
return gadget.jio_remove(options.jio_key) | ||
.push(function () { | ||
return gadget.notifySubmitted({message: "Document Deleted", status: "success"}); | ||
return gadget.notifySubmitted({message: "Document Deleted", status: "success"}) | ||
}, function (error) { | ||
return gadget.notifySubmitted({message: error.message, status: "error"}) | ||
|
||
}) | ||
.push(function () { | ||
return gadget.redirect({command: 'change', options: { | ||
page: options.return_url || 'settings_configurator' | ||
}}); | ||
}); | ||
}); | ||
}, {mutex: 'render'}); | ||
}(window, rJS)); |