diff --git a/src/components/global/CustomSeo.server.tsx b/src/components/global/CustomSeo.server.tsx index e09d4dc..a766cae 100644 --- a/src/components/global/CustomSeo.server.tsx +++ b/src/components/global/CustomSeo.server.tsx @@ -9,11 +9,13 @@ export type CustomSeoProps = Partial & { }; export function CustomSeo(props: CustomSeoProps) { const { data = {}, ...rest } = props; - const { data: { shop: { name, description } = {} } = {}, errors } = useShopQuery({ + const { data: shopData, errors } = useShopQuery({ query: SHOP_INFO_QUERY, cache: CacheLong(), preload: "*", }); + const { shop } = shopData ?? {}; + const { name, description } = shop ?? {}; if (errors) console.log(errors); diff --git a/src/routes/api/contact.server.ts b/src/routes/api/contact.server.ts index 93a1a54..87a171e 100644 --- a/src/routes/api/contact.server.ts +++ b/src/routes/api/contact.server.ts @@ -12,6 +12,7 @@ const client = new SESClient({ }); export async function api(request: HydrogenRequest) { + console.log(request); if (request.method === "GET") return new Response(null, { status: 302, headers: { Location: "/contact-us" } }); if (request.method !== "POST") return new Response(null, { status: 405 }); @@ -26,6 +27,7 @@ export async function api(request: HydrogenRequest) { ) return new Response(null, { status: 400 }); + console.log("correct types", name, email, message, recaptchaToken); let potentiallySpam = false; if (recaptchaToken && typeof recaptchaToken === "string") { const recaptchaResponse = await fetch("https://www.google.com/recaptcha/api/siteverify", { @@ -44,6 +46,7 @@ export async function api(request: HydrogenRequest) { } else { potentiallySpam = true; } + console.log(potentiallySpam, "potentially spam"); const date = new Intl.DateTimeFormat("en-US", { month: "long", day: "numeric",