From 7a160564ae3340a0723c17085ce06b348d7b0eb7 Mon Sep 17 00:00:00 2001 From: Blake Mason Date: Mon, 21 Aug 2023 12:54:11 -0700 Subject: [PATCH] [B] Troubleshooting failing request in dev deployment --- lib/api/efd.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/api/efd.js b/lib/api/efd.js index 3e5ee364..ca58ffd7 100644 --- a/lib/api/efd.js +++ b/lib/api/efd.js @@ -1,18 +1,23 @@ import useSWR from "swr"; - +const EFD_URL = process.env.NEXT_PUBLIC_EFD_URL; const fetcher = (url) => fetch(url, { method: "GET", headers: { "Content-Type": "application/json" }, }).then((res) => { + // eslint-disable-next-line no-console + console.log("raw", res); return res.json(); }); export default function useEfd() { const url = process.env.NEXT_PUBLIC_EFD_URL; + // eslint-disable-next-line no-console + console.log("urls", EFD_URL, url, process.env.NEXT_PUBLIC_EFD_URL); const { data, error } = useSWR(url, fetcher); - + // eslint-disable-next-line no-console + console.log("response:", { data, isLoading: !error && !data, error }); return { data, isLoading: !error && !data,