From 2317564930412f982c764837e8afccc0e988955e Mon Sep 17 00:00:00 2001 From: dauren_yesserkepov Date: Mon, 10 Aug 2026 09:30:18 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=BE=D1=82=D0=BD=D0=BE=D1=81=D0=B8?= =?UTF-8?q?=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B5=20=D0=BF=D1=83=D1=82?= =?UTF-8?q?=D0=B8=20=D0=BA=20API=20(=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0?= =?UTF-8?q?=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20=D0=BF=D1=80=D0=BE=D0=BA?= =?UTF-8?q?=D1=81=D0=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/script.js b/script.js index a2a0573..cb459df 100644 --- a/script.js +++ b/script.js @@ -4,6 +4,9 @@ function api(url, opts) { return r.json(); }); } +function noServer(err) { + return /Failed to fetch|Unexpected token|Пока никто не подтвердил участие.'; document.getElementById("confirmedCount").hidden = false; document.getElementById("confirmedCount").querySelector("b").textContent = j.total; - return api("/api/wish"); + return api("api/wish"); }) .then(function (j) { renderAdminWishes(j.data); }) .catch(function (err) { @@ -148,7 +151,7 @@ document.getElementById("a-wadd").addEventListener("click", function () { var title = document.getElementById("a-wtitle").value.trim(); var emoji = document.getElementById("a-wemoji").value.trim() || "🎁"; if (!title) return; - api("/api/admin/wish", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ pin: pin, title: title, emoji: emoji }) }) + api("api/admin/wish", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ pin: pin, title: title, emoji: emoji }) }) .then(function (j) { renderAdminWishes(j.data); renderWishes(j.data); document.getElementById("a-wtitle").value = "";