Skip to content

Commit

Permalink
fix bug contact error
Browse files Browse the repository at this point in the history
  • Loading branch information
eonurk committed Jul 29, 2024
1 parent 71e6b89 commit 08ba241
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/ContactForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export function ContactFormDemo() {
try {
const response = await fetch(
"https://script.google.com/macros/s/AKfycbxUVRtZlOusMMHw-B076NRY0mapwcWGwgKP_naDoVlEYc_NC2TO6mNEKdYtvNNHNPSwcg/exec",

{
method: "POST",
headers: {
Expand All @@ -54,9 +55,8 @@ export function ContactFormDemo() {
);

const result = await response.json();
console.log("HERE:");
console.log(result);
if (result.result === "success") {

if (result.ok === "success") {
toast({
title: "Success!",
description: "Your message has been sent.",
Expand All @@ -73,7 +73,9 @@ export function ContactFormDemo() {
toast({
title: "Error!",
variant: "destructive",
description: `There was a problem submitting your form: ${error.message}`,
description: `There was a problem submitting your form: ${
(error as Error).message
}`,
});
}
}
Expand Down

0 comments on commit 08ba241

Please sign in to comment.