Add API_BASE and fix URL in DocsSync.tsx
cgen-10251b5ee6e246c7894c03e1c7527933
This commit is contained in:
parent
319e68ae56
commit
4d47c0d5ff
3 changed files with 9 additions and 3 deletions
|
|
@ -1,4 +1,6 @@
|
|||
import { useEffect, useState } from "react";
|
||||
|
||||
const API_BASE = import.meta.env.VITE_API_BASE || "";
|
||||
import { useNavigate, useSearchParams } from "react-router-dom";
|
||||
import { useAuth } from "@/contexts/AuthContext";
|
||||
import Layout from "@/components/Layout";
|
||||
|
|
@ -39,7 +41,7 @@ export default function DiscordOAuthCallback() {
|
|||
setMessage("Processing authentication...");
|
||||
|
||||
// Call backend to handle OAuth exchange
|
||||
const response = await fetch("/api/discord/oauth/callback", {
|
||||
const response = await fetch(`${API_BASE}/api/discord/oauth/callback`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
import { useState, useEffect } from "react";
|
||||
|
||||
const API_BASE = import.meta.env.VITE_API_BASE || "";
|
||||
import { useNavigate, useSearchParams } from "react-router-dom";
|
||||
import { useAuth } from "@/contexts/AuthContext";
|
||||
import Layout from "@/components/Layout";
|
||||
|
|
@ -74,7 +76,7 @@ export default function DiscordVerify() {
|
|||
setDiscordUser(null);
|
||||
|
||||
try {
|
||||
const response = await fetch("/api/discord/verify-code", {
|
||||
const response = await fetch(`${API_BASE}/api/discord/verify-code`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
import { useState } from "react";
|
||||
|
||||
const API_BASE = import.meta.env.VITE_API_BASE || "";
|
||||
import Layout from "@/components/Layout";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
|
|
@ -34,7 +36,7 @@ export default function DocsSync() {
|
|||
setError(null);
|
||||
|
||||
try {
|
||||
const response = await fetch("/api/sync-docs-gitbook", {
|
||||
const response = await fetch(`${API_BASE}/api/sync-docs-gitbook`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
|
|
|||
Loading…
Reference in a new issue