Fixed a bug in the patch dialog (DropdownComponent)

This commit is contained in:
Mathias Wagner
2022-08-28 22:29:46 +02:00
parent 2a849977fe
commit 7cab39e10a

View File

@@ -54,13 +54,13 @@ function DropdownComponent() {
onSuccess: () => reload ? reloadConfig() : "", onClose: () => reloadConfig()
});
const patchDialog = (value, dialog, toggle = true) => {
const patchDialog = (key, dialog, toggle = true) => {
if (toggle) toggleDropdown();
setDialog({
...dialog(config[value]),
...dialog(config[key]),
onSuccess: value => {
fetch("/api/config/" + value, {headers, method: "PATCH", body: JSON.stringify({value})})
fetch("/api/config/" + key, {headers, method: "PATCH", body: JSON.stringify({value})})
.then(() => showFeedback());
}
})