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