Skip to content

Commit

Permalink
add variables for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
drtechie committed Nov 14, 2024
1 parent 279e20a commit a66dfcf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pages/contact.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const page_data = {
};
let message = "";
let messageType = "";
let url = ""
let data = ""
if (Astro.request.method === "POST") {
try {
const formData = await Astro.request.formData();
Expand All @@ -19,6 +21,9 @@ if (Astro.request.method === "POST") {
body: formData,
});
url = `${Astro.url}/api/sendEmail`
data = await response.text();
const data = await response.json();
if (response.status === 200) {
message = data.message;
Expand Down Expand Up @@ -53,6 +58,8 @@ if (Astro.request.method === "POST") {
{message && (
<div class={`message ${messageType === 'success' ? 'success' : 'error'}`}>
<p>{message}</p>
<p>{url}</p>
<p>{data}</p>
</div>
)}
<form
Expand Down

0 comments on commit a66dfcf

Please sign in to comment.