Skip to content

Commit

Permalink
リファクタ
Browse files Browse the repository at this point in the history
  • Loading branch information
masataka committed Jun 30, 2024
1 parent c4aa417 commit 7d47c7f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions contact/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,20 @@ const App = () => {
const postForm = async () => {
// Send data to Slack
if (formData) {
const { name, email, business, content } = formData;
try {
await fetch("/slack", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
text: `
お問い合わせ:
お名前: ${formData.name}
メール: ${formData.email}
ご用件: ${formData.business}
内容: ${formData.content}`,
text: `お問い合わせ/nお名前: ${name}/nメール: ${email}/nご用件: ${business}/n内容: ${content}`,
}),
});
setStage("posted");
} catch (error) {
console.error("Error sending form data to Slack:", error);
console.error("お問い合わせフォーム送信エラー:", error);
}
}
};
Expand Down

0 comments on commit 7d47c7f

Please sign in to comment.