From 2c9bf534079d82f78e45ac33fd462d1e760458b0 Mon Sep 17 00:00:00 2001 From: fullsizemalt <106900403+fullsizemalt@users.noreply.github.com> Date: Sat, 20 Dec 2025 22:21:54 -0800 Subject: [PATCH] fix: Update frontend to use new /shows/recent and /stats/top-songs endpoints --- frontend/app/page.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/app/page.tsx b/frontend/app/page.tsx index c1c3758..15d343d 100644 --- a/frontend/app/page.tsx +++ b/frontend/app/page.tsx @@ -23,13 +23,13 @@ interface Show { interface Song { id: number title: string - times_played?: number + performance_count?: number avg_rating?: number } async function getRecentShows(): Promise { try { - const res = await fetch(`${getApiUrl()}/shows?limit=8&sort=date&order=desc`, { + const res = await fetch(`${getApiUrl()}/shows/recent?limit=8`, { cache: 'no-store', next: { revalidate: 60 } }) @@ -43,7 +43,7 @@ async function getRecentShows(): Promise { async function getTopSongs(): Promise { try { - const res = await fetch(`${getApiUrl()}/songs?limit=5&sort=times_played&order=desc`, { + const res = await fetch(`${getApiUrl()}/stats/top-songs?limit=5`, { cache: 'no-store', next: { revalidate: 300 } }) @@ -182,9 +182,9 @@ export default async function Home() {
{song.title}
- {song.times_played && ( + {song.performance_count && (
- {song.times_played} performances + {song.performance_count} performances
)}