diff options
author | Alexander Moisseev <moiseev@mezonplus.ru> | 2018-07-25 10:42:02 +0300 |
---|---|---|
committer | Alexander Moisseev <moiseev@mezonplus.ru> | 2018-07-25 10:42:02 +0300 |
commit | d8977873d6e6552b0290c0171c6908c6c45bb24f (patch) | |
tree | f04c0820f6dc39e2c6567e86933c5350661391f5 /interface/js/app/symbols.js | |
parent | 6d95ea817c68b5fd507ec85b63ce1d7f8b4295e5 (diff) | |
download | rspamd-d8977873d6e6552b0290c0171c6908c6c45bb24f.tar.gz rspamd-d8977873d6e6552b0290c0171c6908c6c45bb24f.zip |
[WebUI] Refactor query functions into one
Diffstat (limited to 'interface/js/app/symbols.js')
-rw-r--r-- | interface/js/app/symbols.js | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/interface/js/app/symbols.js b/interface/js/app/symbols.js index 9c00a5de5..a8a0cc769 100644 --- a/interface/js/app/symbols.js +++ b/interface/js/app/symbols.js @@ -41,22 +41,20 @@ define(["jquery", "footable"], }); }); - (function (callback) { - callback(url, - function () { - rspamd.alertMessage("alert-modal alert-success", "Symbols successfully saved"); - }, - function (serv, jqXHR, textStatus, errorThrown) { - var serv_name = (typeof serv === "string") ? serv : serv.name; - rspamd.alertMessage("alert-modal alert-error", - "Save symbols error on " + serv_name + ": " + errorThrown); - }, - "POST", {}, { - data: JSON.stringify(values), - dataType: "json", - } - ); - }((is_cluster) ? rspamd.queryNeighbours : rspamd.queryLocal)); + rspamd.query(url, + function () { + rspamd.alertMessage("alert-modal alert-success", "Symbols successfully saved"); + }, + function (serv, jqXHR, textStatus, errorThrown) { + var serv_name = (typeof serv === "string") ? serv : serv.name; + rspamd.alertMessage("alert-modal alert-error", + "Save symbols error on " + serv_name + ": " + errorThrown); + }, + "POST", {}, { + data: JSON.stringify(values), + dataType: "json", + }, {}, is_cluster + ); } function decimalStep(number) { var digits = ((Number(number)).toFixed(20)).replace(/^-?\d*\.?|0+$/g, "").length; |