diff --git a/frontend/src/app/actions.tsx b/frontend/src/app/actions.tsx index aaf1dcb..3e5018b 100644 --- a/frontend/src/app/actions.tsx +++ b/frontend/src/app/actions.tsx @@ -51,8 +51,7 @@ export async function updateAlbum(formData: FormData) { }); } -export async function deleteAlbum(formData: FormData) { - const id = formData.get('id'); +export async function deleteAlbum(id: number) { return fetch("https://api.anatid.net/album", { method: "DELETE", headers: { "Content-Type": "application/json" }, @@ -113,8 +112,7 @@ export async function updateSong(formData: FormData) { }); } -export async function deleteSong(formData: FormData) { - const id = formData.get('id'); +export async function deleteSong(id: number) { return fetch("https://api.anatid.net/song", { method: "DELETE", headers: { "Content-Type": "application/json" }, diff --git a/frontend/src/app/album/page.tsx b/frontend/src/app/album/page.tsx index 649aed6..bd0ee15 100644 --- a/frontend/src/app/album/page.tsx +++ b/frontend/src/app/album/page.tsx @@ -3,7 +3,7 @@ import { FormEvent, MouseEvent, useState, useEffect } from 'react'; import Link from 'next/link'; import { Album } from '@/entities/album.entity'; -import { createAlbum, getAlbum, getAlbums, updateAlbum } from '@/app/actions'; +import { createAlbum, deleteAlbum, getAlbum, getAlbums, updateAlbum } from '@/app/actions'; import Button from 'react-bootstrap/Button'; import Modal from 'react-bootstrap/Modal'; import { IconButton } from '@mui/material'; @@ -131,7 +131,7 @@ export default function Page() { - +