diff --git a/frontend/src/app/album/[id]/page.tsx b/frontend/src/app/album/[id]/page.tsx index ea0db4f..f77f583 100644 --- a/frontend/src/app/album/[id]/page.tsx +++ b/frontend/src/app/album/[id]/page.tsx @@ -52,20 +52,12 @@ export default function Page() { try { if (formData.get('id') == "") { await createSong(formData).then(response => { - if (response.ok) { - handleSnackbar(`Successfully created Song with ID ${formData.get("id")}: ${JSON.stringify(response)}`, true); - } else { - handleSnackbar(`Failed to create Song with ID ${formData.get("id")}: ${JSON.stringify(response)}`, false); - } + handleSnackbar(`Successfully created Song with ID ${formData.get("id")}: ${JSON.stringify(response)}`, true); }) .catch(error => {handleSnackbar(`Failed to create Song with ID ${formData.get("id")}: ${JSON.stringify(error)}`, false);}); } else { await updateSong(formData).then(response => { - if (response.ok) { - handleSnackbar(`Successfully created Song with ID ${formData.get("id")}: ${JSON.stringify(response)}`, true); - } else { - handleSnackbar(`Failed to create Song with ID ${formData.get("id")}: ${JSON.stringify(response)}`, false); - } + handleSnackbar(`Successfully created Song with ID ${formData.get("id")}: ${JSON.stringify(response)}`, true); }) .catch(error => {handleSnackbar(`Failed to create Song with ID ${formData.get("id")}: ${JSON.stringify(error)}`, false);}); } diff --git a/frontend/src/app/album/page.tsx b/frontend/src/app/album/page.tsx index 2c52a72..60ae4b5 100644 --- a/frontend/src/app/album/page.tsx +++ b/frontend/src/app/album/page.tsx @@ -48,21 +48,13 @@ export default function Page() { if (formData.get('id') == "") { await createAlbum(formData) .then(response => { - if (response.ok) { - handleSnackbar(`Successfully created Album with ID ${formData.get("id")}: ${JSON.stringify(response)}`, true); - } else { - handleSnackbar(`Failed to create Album with ID ${formData.get("id")}: ${JSON.stringify(response)}`, false); - } + handleSnackbar(`Successfully created Album with ID ${formData.get("id")}: ${JSON.stringify(response)}`, true); }) .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")}: ${JSON.stringify(response)}`, true); - } else { - handleSnackbar(`Failed to update Album with ID ${formData.get("id")}: ${JSON.stringify(response)}`, false); - } + handleSnackbar(`Successfully updated Album with ID ${formData.get("id")}: ${JSON.stringify(response)}`, true); }) .catch(error => {handleSnackbar(`Failed to update Album with ID ${formData.get("id")}: ${JSON.stringify(error)}`, false);}); }