Skip to content

Commit

Permalink
Handle undefined API URL in ClientApi by providing a default empty st…
Browse files Browse the repository at this point in the history
…ring
  • Loading branch information
renatodellosso committed Dec 30, 2024
1 parent 25d464b commit 2bb6e38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/api/ClientApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import { RequestHelper } from "unified-api";
import { createNextRoute, NextApiTemplate } from "unified-api-nextjs";

const requestHelper = new RequestHelper(
process.env.NEXT_PUBLIC_API_URL,
process.env.NEXT_PUBLIC_API_URL ?? "", // Replace undefined when env is not present (ex: for testing builds)
(url) =>
toast.error(
`Unauthorized API request: ${url}. If this is an error, please contact the developers.`,
Expand Down

0 comments on commit 2bb6e38

Please sign in to comment.