fix: Add xcall to Frappe's web bundle (backport #15146) (#15152)

Co-authored-by: Omar Younis <oimyounis@gmail.com>
This commit is contained in:
mergify[bot] 2021-12-02 10:58:36 +05:30 committed by GitHub
parent fe7b0719cd
commit ba094e76d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,6 +46,20 @@ $.extend(frappe, {
hide_message: function() {
$('.message-overlay').remove();
},
xcall: function(method, params) {
return new Promise((resolve, reject) => {
frappe.call({
method: method,
args: params,
callback: (r) => {
resolve(r.message);
},
error: (r) => {
reject(r.message);
}
});
});
},
call: function(opts) {
// opts = {"method": "PYTHON MODULE STRING", "args": {}, "callback": function(r) {}}
if (typeof arguments[0]==='string') {