diff --git a/frontend/src/app/album/page.tsx b/frontend/src/app/album/page.tsx index af6eea1..6ba1bb2 100644 --- a/frontend/src/app/album/page.tsx +++ b/frontend/src/app/album/page.tsx @@ -49,20 +49,20 @@ export default function Page() { await createAlbum(formData) .then(response => { if (response.ok) { - handleSnackbar(`Successfully created Album with ID ${formData.get("id")}: ${response.json()}`, true); + handleSnackbar(`Successfully created Album with ID ${formData.get("id")}: ${JSON.stringify(response)}`, true); } - handleSnackbar(`Failed to create Album with ID ${formData.get("id")}: ${response.json()}`, false); + handleSnackbar(`Failed to create Album with ID ${formData.get("id")}: ${JSON.stringify(response)}`, false); }) - .catch(error => {handleSnackbar(`Failed to create Album with ID ${formData.get("id")}: ${error.json()}`, false);}); + .catch(error => {handleSnackbar(`Failed to create Album with ID ${formData.get("id")}: ${JSON.stringify(error)}`, false);}); } else { await updateAlbum(formData) .then(response => { if (response.ok) { - handleSnackbar(`Successfully updated Album with ID ${formData.get("id")}: ${response.json()}`, true); + handleSnackbar(`Successfully updated Album with ID ${formData.get("id")}: ${JSON.stringify(response)}`, true); } - handleSnackbar(`Failed to update Album with ID ${formData.get("id")}: ${response.json()}`, false); + handleSnackbar(`Failed to update Album with ID ${formData.get("id")}: ${JSON.stringify(response)}`, false); }) - .catch(error => {handleSnackbar(`Failed to update Album with ID ${formData.get("id")}: ${error.json()}`, false);}); + .catch(error => {handleSnackbar(`Failed to update Album with ID ${formData.get("id")}: ${JSON.stringify(error)}`, false);}); } revalidateAlbums(); const data = await getAlbums();