From 4981d32a1e7d426d2065a659c51877aeb78b2c2d Mon Sep 17 00:00:00 2001 From: posimai Date: Tue, 21 Apr 2026 19:53:05 +0900 Subject: [PATCH] =?UTF-8?q?feat(store):=20=E3=81=8A=E5=95=8F=E3=81=84?= =?UTF-8?q?=E5=90=88=E3=82=8F=E3=81=9B=E3=83=95=E3=82=A9=E3=83=BC=E3=83=A0?= =?UTF-8?q?=E3=82=92=20Resend=20API=20=E3=81=AB=E5=88=87=E3=82=8A=E6=9B=BF?= =?UTF-8?q?=E3=81=88=EF=BC=88Formspree=20=E5=BB=83=E6=AD=A2=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contact.html | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/contact.html b/contact.html index 44ac15c..c437d36 100644 --- a/contact.html +++ b/contact.html @@ -169,8 +169,7 @@

お問い合わせ

通常 1〜2 営業日以内にご返信します

- -
+
@@ -205,9 +204,6 @@
- - -
@@ -230,18 +226,27 @@ btn.disabled = true; btn.textContent = '送信中...'; + const data = { + type: document.getElementById('type').value, + name: document.getElementById('name').value, + email: document.getElementById('email').value, + subject: document.getElementById('subject').value, + message: document.getElementById('message').value, + }; + try { - const res = await fetch(form.action, { + const res = await fetch('https://api.soar-enrich.com/api/store/contact', { method: 'POST', - body: new FormData(form), - headers: { Accept: 'application/json' } + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(data), }); if (res.ok) { form.style.display = 'none'; success.style.display = 'block'; } else { - alert('送信に失敗しました。時間をおいて再度お試しください。'); + const err = await res.json().catch(() => ({})); + alert(err.error || '送信に失敗しました。時間をおいて再度お試しください。'); btn.disabled = false; btn.textContent = '送信する'; }