mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 04:38:28 +00:00
Fix errors happening when editing groups/clients/domains/lists not being shown. Also fix logic of the strings "enabling/disabling" as the variable "enabled" already has the new (not the current state). This was correct in groups.js, but not the others
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* This file is copyright under the latest version of the EUPL.
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
/* global utils:false, apiFailure:false, updateFtlInfo:false */
|
||||
/* global utils:false, apiFailure:false, updateFtlInfo:false, processGroupResult:false */
|
||||
|
||||
var table,
|
||||
idNames = {};
|
||||
@@ -344,10 +344,10 @@ function editGroup() {
|
||||
var notDone = "editing";
|
||||
switch (elem) {
|
||||
case "enabled_" + id:
|
||||
if (enabled === false) {
|
||||
if (!enabled) {
|
||||
done = "disabled";
|
||||
notDone = "disabling";
|
||||
} else if (enabled === true) {
|
||||
} else {
|
||||
done = "enabled";
|
||||
notDone = "enabling";
|
||||
}
|
||||
@@ -378,9 +378,10 @@ function editGroup() {
|
||||
comment: comment,
|
||||
enabled: enabled,
|
||||
}),
|
||||
success: function () {
|
||||
success: function (data) {
|
||||
utils.enableAll();
|
||||
utils.showAlert("success", "fas fa-pencil-alt", "Successfully " + done + " group", oldName);
|
||||
processGroupResult(data, "group", done, notDone);
|
||||
table.ajax.reload(null, false);
|
||||
},
|
||||
error: function (data, exception) {
|
||||
apiFailure(data);
|
||||
|
||||
Reference in New Issue
Block a user