diff --git a/app/edit/[id]/page.tsx b/app/edit/[id]/page.tsx index 4422a66..706fc12 100644 --- a/app/edit/[id]/page.tsx +++ b/app/edit/[id]/page.tsx @@ -65,8 +65,7 @@ export default function EditStream() { team_id: streamData.team_id, }); - // Handle both old and new API response formats - const teams = teamsData.success ? teamsData.data : teamsData; + const teams = teamsData.data; // Map teams for dropdown setTeams( diff --git a/app/page.tsx b/app/page.tsx index e90a6a5..b99c179 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -80,12 +80,8 @@ export default function Home() { activeRes.json() ]); - // Handle both old and new API response formats - const streams = streamsData.success ? streamsData.data : streamsData; - const activeSources = activeData.success ? activeData.data : activeData; - - setStreams(streams); - setActiveSources(activeSources); + setStreams(streamsData.data); + setActiveSources(activeData); } catch (error) { console.error('Error fetching data:', error); showError('Failed to Load Data', 'Could not fetch streams. Please refresh the page.'); diff --git a/app/streams/page.tsx b/app/streams/page.tsx index 8520c19..2f23e7c 100644 --- a/app/streams/page.tsx +++ b/app/streams/page.tsx @@ -40,9 +40,8 @@ export default function AddStream() { const teamsData = await teamsResponse.json(); const streamsData = await streamsResponse.json(); - // Handle both old and new API response formats - const teams = teamsData.success ? teamsData.data : teamsData; - const streams = streamsData.success ? streamsData.data : streamsData; + const teams = teamsData.data; + const streams = streamsData.data; // Map the API data to the format required by the Dropdown setTeams( diff --git a/app/teams/page.tsx b/app/teams/page.tsx index 7b877e4..bb8684a 100644 --- a/app/teams/page.tsx +++ b/app/teams/page.tsx @@ -41,9 +41,7 @@ export default function Teams() { try { const res = await fetch('/api/teams'); const data = await res.json(); - // Handle both old and new API response formats - const teams = data.success ? data.data : data; - setTeams(teams); + setTeams(data.data); } catch (error) { console.error('Error fetching teams:', error); } finally { diff --git a/components/Footer.tsx b/components/Footer.tsx index 3d4328c..b3f4b2f 100644 --- a/components/Footer.tsx +++ b/components/Footer.tsx @@ -50,9 +50,7 @@ export default function Footer() { try { const response = await fetch('/api/counts'); const data = await response.json(); - // Handle both old and new API response formats - const countsData = data.success ? data.data : data; - setCounts(countsData); + setCounts(data.data); } catch (error) { console.error('Failed to fetch counts:', error); }