diff --git a/frontend/src/app/album/page.tsx b/frontend/src/app/album/page.tsx index 583da48..a0d15cf 100644 --- a/frontend/src/app/album/page.tsx +++ b/frontend/src/app/album/page.tsx @@ -47,14 +47,15 @@ export default function Page() { try { if (formData.get('id') == "") { const result = createAlbum(formData) - .then(respose => {return response.json()}) - .catch(error => {response.json()}); + .then(response => {return response.json()}) + .catch(error => {return error.json()}); + handleSnackbar(`Successfully updated Album with ID ${formData.get("id")}: ${result}`, true); } else { - const result = await updateAlbum(formData) - .then(respose => {return response.json()}) - .catch(error => {response.json()}); + const result = updateAlbum(formData) + .then(response => {return response.json()}) + .catch(error => {return error.json()}); + handleSnackbar(`Successfully updated Album with ID ${formData.get("id")}: ${result}`, true); } - handleSnackbar(`Successfully updated Album with ID ${formData.get("id")}: ${result}`, true); revalidateAlbums(); const data = await getAlbums(); setAlbums(data);