From 3e48bda7cfad4f5c83dbc0a9776708a101b1b3c4 Mon Sep 17 00:00:00 2001 From: Foxix Date: Mon, 11 Aug 2025 11:38:00 +0300 Subject: [PATCH] Bug fix: favourites page --- src/app/favorites/page.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/app/favorites/page.tsx b/src/app/favorites/page.tsx index 713bbde..624e7b3 100644 --- a/src/app/favorites/page.tsx +++ b/src/app/favorites/page.tsx @@ -30,7 +30,16 @@ export default function FavoritesPage() { try { const response = await neoApi.get('/api/v1/favorites'); - setFavorites(response.data); + const items = Array.isArray(response.data) + ? response.data.map((m: any) => ({ + id: m.id, + mediaId: String(m.id), + mediaType: 'movie' as const, + title: m.title ?? m.name ?? '', + posterPath: m.poster_path ?? '', + })) + : []; + setFavorites(items); } catch (error: any) { console.error('Failed to fetch favorites:', error); // Редиректим только при явном 401