feat: handleSave Funktion ausgelagert und KueModal strukturiert

- handleSave in separate Datei handle-save.js ausgelagert, um KueModal-Komponente modularer und wartbarer zu gestalten
- handleSaveWrapper in KueModal hinzugefügt, um Parameter an handleSave zu übergeben
- KueModal umgestaltet, um Funktionen und Redux-Dispatch klarer zu organisieren
- Konsistente Verwendung von Parametern und State-Updates für sauberen Codefluss
This commit is contained in:
ISA
2024-11-09 19:11:55 +01:00
parent 0f938953db
commit c4e89d690c
9 changed files with 106 additions and 88 deletions

View File

@@ -0,0 +1,19 @@
// components/modales/handlers/handleReboot.js
const handleReboot = () => {
if (
window.confirm("Sind Sie sicher, dass Sie den CPL neu starten möchten?")
) {
let currentPath = window.location.pathname;
if (!currentPath.endsWith(".html")) {
currentPath += ".html";
}
const url = `${window.location.origin}/CPL?${currentPath}&BOOT=1`;
console.log(url);
fetch(url, { method: "GET" }).finally(() => {
window.location.href = `/wait`;
});
}
};
export default handleReboot;