Adding basic delete function
Some checks failed
Music Collection CI Workflow / test (./backend) (push) Successful in 22s
Music Collection CI Workflow / test (./frontend) (push) Successful in 28s
Music Collection CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/msuic-collection-backend, ./backend) (push) Successful in 49s
Music Collection CI Workflow / deploy (push) Has been cancelled
Music Collection CI Workflow / build-and-push-images (./frontend/Dockerfile, git.anatid.net/tabris/music-collection-frontend, ./frontend) (push) Has been cancelled
Some checks failed
Music Collection CI Workflow / test (./backend) (push) Successful in 22s
Music Collection CI Workflow / test (./frontend) (push) Successful in 28s
Music Collection CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/msuic-collection-backend, ./backend) (push) Successful in 49s
Music Collection CI Workflow / deploy (push) Has been cancelled
Music Collection CI Workflow / build-and-push-images (./frontend/Dockerfile, git.anatid.net/tabris/music-collection-frontend, ./frontend) (push) Has been cancelled
This commit is contained in:
parent
4483f45c52
commit
cfb6fc62a9
@ -81,6 +81,19 @@ export default function Page() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleDelete = async (event: MouseEvent<HTMLElement>) => {
|
||||||
|
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 <div>Loading...</div>
|
if (!albums) return <div>Loading...</div>
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user