Skip to content

Commit

Permalink
fix: fix api request on the saas due to appending api instead of using
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe authored and moshloop committed Jul 25, 2024
1 parent 1adec1c commit 323666c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/api/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { toastError } from "../components/Toast/toast";

const isClerkAuthSystem = !!process.env.NEXT_PUBLIC_AUTH_IS_CLERK === true;

const API_BASE = "/api";
// The base URL for the API is either / or /api depending on the auth system,
// for clerk the base URL is /, for the rest it is /api
const API_BASE = isClerkAuthSystem ? "/" : "/api";

export const apiBase = axios.create({
baseURL: `${API_BASE}`,
Expand Down

0 comments on commit 323666c

Please sign in to comment.