diff --git a/src/main/webapp/resources/js/base/base-fims.js b/src/main/webapp/resources/js/base/base-fims.js index f05577a9..a7e466ca 100644 --- a/src/main/webapp/resources/js/base/base-fims.js +++ b/src/main/webapp/resources/js/base/base-fims.js @@ -546,51 +546,18 @@ const Apply = { }, fromDatasetControl : { load : async function(control, pageNum){ - control.query.pageNum = pageNum; - if (!control.query.pageNum){ - control.query.pageNum = 1; - } - ajax.get({ - url:control.urls.load, - data:control.query, - success:(resp) => { - resolve(resp); - } - }); - }, - save : async function(control, info){ - if (!info) { - return; - } - - var item = control.getCurrent("item"); - var create = "added" == item.state; - - ajax.post({ - url:!create ? control.urls.update : control.urls.create, - data:info, - success:(resp) => { - resolve(resp); - } - }); - }, - remove : async function(control, params){ - var selected = control.dataset.getKeys("selected"); - if(selected.length < 1) { - return; - } - - if(!params) { - params = {}; - params[control.prefixed("IDs")] = selected.join(","); - } - - ajax.post({ - url:control.urls.remove, - data:params, - success:(resp) => { - resolve(resp); + return new Promise((resolve, reject) => { + control.query.pageNum = pageNum; + if (!control.query.pageNum){ + control.query.pageNum = 1; } + ajax.get({ + url:control.urls.load, + data:control.query, + success:(resp) => { + resolve(resp); + } + }); }); } }