diff --git a/README.md b/README.md index bf37aab..be20d69 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ version: '3.8' services: kv-tube-app: - image: git.khoavo.myds.me/vndangkhoa/kv-tube-app:v4.0.5 + image: git.khoavo.myds.me/vndangkhoa/kv-tube-app:v4.0.6 container_name: kv-tube-app restart: unless-stopped ports: diff --git a/docker-compose.yml b/docker-compose.yml index 6854f6a..285a2cd 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ version: '3.8' services: kv-tube-app: - image: git.khoavo.myds.me/vndangkhoa/kv-tube-app:v4.0.5 + image: git.khoavo.myds.me/vndangkhoa/kv-tube-app:v4.0.6 container_name: kv-tube-app platform: linux/amd64 restart: unless-stopped diff --git a/frontend/app/feed/library/page.tsx b/frontend/app/feed/library/page.tsx index 5700d46..df622f8 100755 --- a/frontend/app/feed/library/page.tsx +++ b/frontend/app/feed/library/page.tsx @@ -23,7 +23,8 @@ async function getHistory() { try { const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://127.0.0.1:8080'}/api/history?limit=20`, { cache: 'no-store' }); if (!res.ok) return []; - return res.json() as Promise; + const data = await res.json(); + return Array.isArray(data) ? data : []; } catch { return []; } @@ -33,7 +34,8 @@ async function getSubscriptions() { try { const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://127.0.0.1:8080'}/api/subscriptions`, { cache: 'no-store' }); if (!res.ok) return []; - return res.json() as Promise; + const data = await res.json(); + return Array.isArray(data) ? data : []; } catch { return []; } diff --git a/frontend/app/feed/subscriptions/page.tsx b/frontend/app/feed/subscriptions/page.tsx index e39f29d..272173c 100755 --- a/frontend/app/feed/subscriptions/page.tsx +++ b/frontend/app/feed/subscriptions/page.tsx @@ -24,7 +24,8 @@ async function getSubscriptions() { try { const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://127.0.0.1:8080'}/api/subscriptions`, { cache: 'no-store' }); if (!res.ok) return []; - return res.json() as Promise; + const data = await res.json(); + return Array.isArray(data) ? data : []; } catch { return []; } @@ -34,7 +35,8 @@ async function getChannelVideos(channelId: string, limit: number = 5) { try { const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://127.0.0.1:8080'}/api/channel/videos?id=${channelId}&limit=${limit}`, { cache: 'no-store' }); if (!res.ok) return []; - return res.json() as Promise; + const data = await res.json(); + return Array.isArray(data) ? data : []; } catch { return []; }