From e046a154094b2e93f45a4c4c34d7ba81986c0917 Mon Sep 17 00:00:00 2001 From: Claudiu Farcas Date: Sat, 20 Jun 2026 02:28:55 +0000 Subject: [PATCH] feat: update API endpoint references in frontend components for activities, leaderboard, teams, users, and workouts --- octofit-tracker/frontend/src/components/Activities.jsx | 3 +-- octofit-tracker/frontend/src/components/Leaderboard.jsx | 3 +-- octofit-tracker/frontend/src/components/Teams.jsx | 3 +-- octofit-tracker/frontend/src/components/Users.jsx | 3 +-- octofit-tracker/frontend/src/components/Workouts.jsx | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/octofit-tracker/frontend/src/components/Activities.jsx b/octofit-tracker/frontend/src/components/Activities.jsx index fcb390e..94907e7 100644 --- a/octofit-tracker/frontend/src/components/Activities.jsx +++ b/octofit-tracker/frontend/src/components/Activities.jsx @@ -1,5 +1,4 @@ import { useEffect, useState } from 'react' -import { API_BASE } from '../lib/apiBase' function Activities() { const [activities, setActivities] = useState([]) @@ -7,7 +6,7 @@ function Activities() { const [error, setError] = useState(null) useEffect(() => { - fetch(`${API_BASE}/activities/`) + fetch('/api/activities/') .then((res) => { if (!res.ok) throw new Error(`HTTP ${res.status}`) return res.json() diff --git a/octofit-tracker/frontend/src/components/Leaderboard.jsx b/octofit-tracker/frontend/src/components/Leaderboard.jsx index 342378f..89ef414 100644 --- a/octofit-tracker/frontend/src/components/Leaderboard.jsx +++ b/octofit-tracker/frontend/src/components/Leaderboard.jsx @@ -1,5 +1,4 @@ import { useEffect, useState } from 'react' -import { API_BASE } from '../lib/apiBase' function Leaderboard() { const [leaderboards, setLeaderboards] = useState([]) @@ -7,7 +6,7 @@ function Leaderboard() { const [error, setError] = useState(null) useEffect(() => { - fetch(`${API_BASE}/leaderboard/`) + fetch('/api/leaderboard/') .then((res) => { if (!res.ok) throw new Error(`HTTP ${res.status}`) return res.json() diff --git a/octofit-tracker/frontend/src/components/Teams.jsx b/octofit-tracker/frontend/src/components/Teams.jsx index 35de16f..e491b65 100644 --- a/octofit-tracker/frontend/src/components/Teams.jsx +++ b/octofit-tracker/frontend/src/components/Teams.jsx @@ -1,5 +1,4 @@ import { useEffect, useState } from 'react' -import { API_BASE } from '../lib/apiBase' function Teams() { const [teams, setTeams] = useState([]) @@ -7,7 +6,7 @@ function Teams() { const [error, setError] = useState(null) useEffect(() => { - fetch(`${API_BASE}/teams/`) + fetch('/api/teams/') .then((res) => { if (!res.ok) throw new Error(`HTTP ${res.status}`) return res.json() diff --git a/octofit-tracker/frontend/src/components/Users.jsx b/octofit-tracker/frontend/src/components/Users.jsx index c3e7a41..8304023 100644 --- a/octofit-tracker/frontend/src/components/Users.jsx +++ b/octofit-tracker/frontend/src/components/Users.jsx @@ -1,5 +1,4 @@ import { useEffect, useState } from 'react' -import { API_BASE } from '../lib/apiBase' function Users() { const [users, setUsers] = useState([]) @@ -7,7 +6,7 @@ function Users() { const [error, setError] = useState(null) useEffect(() => { - fetch(`${API_BASE}/users/`) + fetch('/api/users/') .then((res) => { if (!res.ok) throw new Error(`HTTP ${res.status}`) return res.json() diff --git a/octofit-tracker/frontend/src/components/Workouts.jsx b/octofit-tracker/frontend/src/components/Workouts.jsx index cfb4c1a..b5fd603 100644 --- a/octofit-tracker/frontend/src/components/Workouts.jsx +++ b/octofit-tracker/frontend/src/components/Workouts.jsx @@ -1,5 +1,4 @@ import { useEffect, useState } from 'react' -import { API_BASE } from '../lib/apiBase' function Workouts() { const [workouts, setWorkouts] = useState([]) @@ -7,7 +6,7 @@ function Workouts() { const [error, setError] = useState(null) useEffect(() => { - fetch(`${API_BASE}/workouts/`) + fetch('/api/workouts/') .then((res) => { if (!res.ok) throw new Error(`HTTP ${res.status}`) return res.json()