diff --git a/app/(sharing)/[token]/[id]/page.tsx b/app/(sharing)/[token]/[id]/page.tsx index a3405e9..20dbcfa 100644 --- a/app/(sharing)/[token]/[id]/page.tsx +++ b/app/(sharing)/[token]/[id]/page.tsx @@ -1,4 +1,4 @@ -import { SharingPlaylogId, getSongsWithTitles } from "@/lib/api"; +import { generatePlaylogId, getSongsWithTitles } from "@/lib/api"; import { shareScore } from "../token"; export default async function Share({ @@ -12,7 +12,7 @@ export default async function Share({ const tokenResult = await shareScore(token); if (tokenResult.error) { - // Handle error appropriately, e.g., render an error message + return

{tokenResult.error}

; } @@ -20,13 +20,13 @@ export default async function Share({ const playlogId = parseInt(id); const songsData = await getSongsWithTitles(userId); - const playlogIds = await SharingPlaylogId(playlogId); + const playlogIds = await generatePlaylogId(playlogId); - const matchingSongs = songsData.filter((song) => + const matchSongToPlaylogId = songsData.filter((song) => playlogIds.includes(song.id) ); - const songTitles = matchingSongs.map((song) => song.title); + const songTitles = matchSongToPlaylogId.map((song) => song.title); return (