Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
chore: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
taciturnaxolotl committed Jun 1, 2024
1 parent 624680f commit 9cfc8ad
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 23 deletions.
6 changes: 3 additions & 3 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import netlify from "@astrojs/netlify/functions";
// https://astro.build/config
export default defineConfig({
redirects: {
"/branding": "/brand"
"/branding": "/brand",
},
output: "server",
adapter: netlify()
});
adapter: netlify(),
});
5 changes: 4 additions & 1 deletion src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ const year = new Date().getFullYear();
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="utf-8" />
<meta property="twitter:card" content="summary_large_image" />
<script defer src="https://umami.purplebubble.org/script.js" data-website-id="3d88503b-9747-416a-a176-7507ffb7c090"></script>
<script
defer
src="https://umami.purplebubble.org/script.js"
data-website-id="3d88503b-9747-416a-a176-7507ffb7c090"></script>
<link
rel="apple-touch-icon"
sizes="180x180"
Expand Down
34 changes: 15 additions & 19 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,27 @@ if (Astro.request.method === "POST") {
const name = data.get("name");
const email = data.get("email");
const response = await fetch('https://catapult.purplebubble.org/api/subscribe', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
const response = await fetch(
"https://catapult.purplebubble.org/api/subscribe",
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ name, email }),
},
body: JSON.stringify({ name, email }),
})
);
const jsondata = await response.json();
console.log(jsondata);
if (jsondata.ok = true){
if ((jsondata.ok = true)) {
//do nothing
} else{
} else {
error = jsondata.error;
}
}
catch (anError) {
} catch (anError) {
if (anError instanceof Error) {
console.log(anError)
console.log(anError);
}
}
}
Expand Down Expand Up @@ -55,13 +56,8 @@ if (Astro.request.method === "POST") {
</p>
</section>
<section>
{error && (
<p class="text-red-500">Error: {error}</p>
)}
<form
method="POST"
accept-charset="utf-8"
>
{error && <p class="text-red-500">Error: {error}</p>}
<form method="POST" accept-charset="utf-8">
<label for="name">Name</label><br />
<input
type="text"
Expand Down

0 comments on commit 9cfc8ad

Please sign in to comment.