From 0e2ca9a2df3cbb98aed2cb0cf2977b15e5d64154 Mon Sep 17 00:00:00 2001 From: Phill Pover Date: Mon, 7 Apr 2025 06:12:25 +0100 Subject: [PATCH] Fixes --- frontend/src/app/actions.tsx | 4 ++-- frontend/src/app/album/[id]/page.tsx | 6 ++++-- frontend/src/app/album/page.tsx | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/actions.tsx b/frontend/src/app/actions.tsx index 7c703a7..58e4ed6 100644 --- a/frontend/src/app/actions.tsx +++ b/frontend/src/app/actions.tsx @@ -125,7 +125,7 @@ export async function getSong(id: number) { } export async function createSong(formData: FormData) { - const albumId = formData.get('album-id'); + const albumId = formData.get('albumId'); const title = formData.get('title'); const duration = formData.get('duration'); const trackNumber = formData.get('trackNumber'); @@ -150,7 +150,7 @@ export async function createSong(formData: FormData) { export async function updateSong(formData: FormData) { const id = formData.get('id'); - const albumId = formData.get('album-id'); + const albumId = formData.get('albumId'); const title = formData.get('title'); const duration = formData.get('duration'); const trackNumber = formData.get('trackNumber'); diff --git a/frontend/src/app/album/[id]/page.tsx b/frontend/src/app/album/[id]/page.tsx index b13da09..40fb632 100644 --- a/frontend/src/app/album/[id]/page.tsx +++ b/frontend/src/app/album/[id]/page.tsx @@ -45,7 +45,7 @@ export default function Page() { const formData = new FormData(event.currentTarget); try { console.log(formData); - if (formData.get('id') === "") { + if (formData.get('id') == "") { const data = await createSong(formData); console.log(data); } else { @@ -108,7 +108,9 @@ export default function Page() { <>
- {album.title} by {album.artist} ({album.genre}) +

{album.title}

+

{album.artist}

+ ({album.genre})
diff --git a/frontend/src/app/album/page.tsx b/frontend/src/app/album/page.tsx index 2dbd5d5..a7ac174 100644 --- a/frontend/src/app/album/page.tsx +++ b/frontend/src/app/album/page.tsx @@ -40,7 +40,7 @@ export default function Page() { const formData = new FormData(event.currentTarget); try { console.log(formData); - if (formData.get('id') === "") { + if (formData.get('id') == "") { await createAlbum(formData); } else { await updateAlbum(formData);