From cfb6fc62a9ba47fddcb7d0fe756172d3b42b9e1f Mon Sep 17 00:00:00 2001 From: Phill Pover Date: Sun, 6 Apr 2025 22:23:42 +0100 Subject: [PATCH] Adding basic delete function --- frontend/src/app/album/page.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/frontend/src/app/album/page.tsx b/frontend/src/app/album/page.tsx index 9cd31e3..649aed6 100644 --- a/frontend/src/app/album/page.tsx +++ b/frontend/src/app/album/page.tsx @@ -81,6 +81,19 @@ export default function Page() { } } + const handleDelete = async (event: MouseEvent) => { + const id = event.currentTarget.getAttribute('album-id'); + if (id) { + try { + await deleteAlbum(parseInt(id)); + } catch (error) { + console.error(`Error deleting album with ID ${id}:`, error); + } + } else { + console.error("Couldn't get ID of clicked element"); + } + } + if (!albums) return
Loading...
return (