diff --git a/frontend/src/app/actions.tsx b/frontend/src/app/actions.tsx index f743860..2d75d17 100644 --- a/frontend/src/app/actions.tsx +++ b/frontend/src/app/actions.tsx @@ -81,7 +81,6 @@ export async function updateAlbum(formData: FormData) { const title = formData.get('title'); const artist = formData.get('artist'); const genre = formData.get('genre'); - console.log(id,title,artist,genre); return fetch(`https://api.anatid.net/album/${id}`, { method: "PUT", headers: { "Content-Type": "application/json" }, diff --git a/frontend/src/app/album/page.tsx b/frontend/src/app/album/page.tsx index c977152..1d44232 100644 --- a/frontend/src/app/album/page.tsx +++ b/frontend/src/app/album/page.tsx @@ -51,7 +51,7 @@ export default function Page() { if (response.ok) { handleSnackbar(`Successfully created Album with ID ${formData.get("id")}: ${response}`, true); } - Promise.reject(response); + handleSnackbar(`Failed to create Album with ID ${formData.get("id")}: ${response}`, false); }) .catch(error => {handleSnackbar(`Failed to create Album with ID ${formData.get("id")}: ${error}`, false);}); } else { @@ -60,7 +60,7 @@ export default function Page() { if (response.ok) { handleSnackbar(`Successfully updated Album with ID ${formData.get("id")}: ${response}`, true); } - Promise.reject(response); + handleSnackbar(`Failed to update Album with ID ${formData.get("id")}: ${response}`, false); }) .catch(error => {handleSnackbar(`Failed to update Album with ID ${formData.get("id")}: ${error}`, false);}); }