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