From 2676268ee6b6ef9f4d81955395cf6760668579ba Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Fri, 16 Feb 2024 09:39:28 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/resources/js/base/base-fims.js | 55 ++++--------------- 1 file changed, 11 insertions(+), 44 deletions(-) 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); + } + }); }); } }