From 78887105fecf02532e2fceac4dc1b14bd773cea5 Mon Sep 17 00:00:00 2001 From: Nik Afiq Date: Wed, 5 Nov 2025 16:17:40 +0900 Subject: [PATCH] Sorted show --- frontend/src/pages/ShowsPage.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/ShowsPage.tsx b/frontend/src/pages/ShowsPage.tsx index d829f8d..ce9054d 100644 --- a/frontend/src/pages/ShowsPage.tsx +++ b/frontend/src/pages/ShowsPage.tsx @@ -69,7 +69,8 @@ export default function ShowsPage() { const res = await fetch(GET_URL, { cache: "no-store" }); if (!res.ok) throw new Error(`HTTP ${res.status}`); const data = (await res.json()) as Show[]; - if (!cancelled) setShows(data); + data.sort((a, b) => a.id - b.id); // ASC + setShows(data); } catch (e: any) { if (!cancelled) setError(e.message || "番組一覧の取得に失敗しました。"); } finally { @@ -131,7 +132,10 @@ export default function ShowsPage() {