Skip to content

Commit

Permalink
[B] Troubleshooting failing request in dev deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake Mason committed Aug 21, 2023
1 parent f00a16e commit 7a16056
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/api/efd.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit 7a16056

Please sign in to comment.