usprawnieni i funkcje oraz zabezpieczenia
This commit is contained in:
@@ -33,7 +33,6 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
};
|
||||
});
|
||||
|
||||
// zapisz przycięty
|
||||
document.getElementById("saveCrop").addEventListener("click", function () {
|
||||
if (!cropper) return;
|
||||
|
||||
@@ -49,13 +48,14 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
.then((res) => res.json())
|
||||
.then((data) => {
|
||||
if (data.success) {
|
||||
location.reload();
|
||||
showToast("Zapisano przycięty paragon", "success");
|
||||
setTimeout(() => location.reload(), 1500);
|
||||
} else {
|
||||
alert("❌ Błąd: " + data.error || "Nieznany");
|
||||
showToast("Błąd: " + (data.error || "Nieznany"), "danger");
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
alert("❌ Błąd sieci");
|
||||
showToast("Błąd sieci", "danger");
|
||||
console.error(err);
|
||||
});
|
||||
}, "image/webp");
|
||||
|
Reference in New Issue
Block a user