mirror of
https://github.com/pi-hole/web.git
synced 2026-04-28 04:33:58 +01: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 apiFailure:false */
|
||||
/* global apiFailure:false, utils:false */
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
var groups = [];
|
||||
@@ -24,3 +24,21 @@ function getGroups() {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
function processGroupResult(data, type, done, notDone) {
|
||||
// Loop over data.processed.success and show toasts
|
||||
data.processed.success.forEach(function (item) {
|
||||
utils.showAlert("success", "fas fa-pencil-alt", `Successfully ${done} ${type}`, item);
|
||||
});
|
||||
// Loop over errors and display them
|
||||
data.processed.errors.forEach(function (error) {
|
||||
console.log(error); // eslint-disable-line no-console
|
||||
utils.showAlert(
|
||||
"error",
|
||||
"",
|
||||
`Error while ${notDone} ${type} ${utils.escapeHtml(error.item)}`,
|
||||
error.error
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user