revert #1650 #1661 #1664 #1670
made panel full of bug
This commit is contained in:
MHSanaei
2024-01-26 22:07:15 +03:30
parent daa4354047
commit 9fba92d879
16 changed files with 57 additions and 388 deletions

View File

@@ -83,41 +83,6 @@ class HttpUtil {
}
return msg;
}
static async jsonPost(url, data) {
let msg;
try {
const requestOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
};
const resp = await fetch(url, requestOptions);
const response = await resp.json();
msg = this._respToMsg({data : response});
} catch (e) {
msg = new Msg(false, e.toString());
}
this._handleMsg(msg);
return msg;
}
static async postWithModalJson(url, data, modal) {
if (modal) {
modal.loading(true);
}
const msg = await this.jsonPost(url, data);
if (modal) {
modal.loading(false);
if (msg instanceof Msg && msg.success) {
modal.close();
}
}
return msg;
}
}
class PromiseUtil {