Fixing final validation message
All checks were successful
Music Collection CI Workflow / test (./backend) (push) Successful in 36s
Music Collection CI Workflow / test (./frontend) (push) Successful in 38s
Music Collection CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/music-collection-backend, ./backend) (push) Successful in 54s
Music Collection CI Workflow / build-and-push-images (./frontend/Dockerfile, git.anatid.net/tabris/music-collection-frontend, ./frontend) (push) Successful in 1m51s
Music Collection CI Workflow / deploy (push) Successful in 24s

This commit is contained in:
Phill Pover 2025-04-07 14:53:43 +01:00
parent 634db87b8c
commit 9c59b723cb
2 changed files with 12 additions and 4 deletions

View File

@ -51,8 +51,12 @@ export default function Page() {
const formData = new FormData(event.currentTarget); const formData = new FormData(event.currentTarget);
try { try {
if (formData.get('id') == "") { if (formData.get('id') == "") {
await createSong(formData).then(() => { await createSong(formData).then((response) => {
handleSnackbar(`Successfully created Song with ID ${formData.get("id")}`, true); if (response.messages) {
handleSnackbar(`Failed to create Song with ID ${formData.get("id")}: ${JSON.stringify(response)}`, false);
} else {
handleSnackbar(`Successfully created Song with ID ${formData.get("id")}`, true);
}
}) })
.catch(error => {handleSnackbar(`Failed to create Song with ID ${formData.get("id")}: ${JSON.stringify(error)}`, false);}); .catch(error => {handleSnackbar(`Failed to create Song with ID ${formData.get("id")}: ${JSON.stringify(error)}`, false);});
} else { } else {

View File

@ -47,8 +47,12 @@ export default function Page() {
try { try {
if (formData.get('id') == "") { if (formData.get('id') == "") {
await createAlbum(formData) await createAlbum(formData)
.then(() => { .then((response) => {
handleSnackbar(`Successfully created Album with ID ${formData.get("id")}`, true); if (response.messages) {
handleSnackbar(`Failed to create Album with ID ${formData.get("id")}: ${JSON.stringify(response)}`, false);
} else {
handleSnackbar(`Successfully created Album with ID ${formData.get("id")}`, true);
}
}) })
.catch(error => {handleSnackbar(`Failed to create Album with ID ${formData.get("id")}: ${JSON.stringify(error)}`, false);}); .catch(error => {handleSnackbar(`Failed to create Album with ID ${formData.get("id")}: ${JSON.stringify(error)}`, false);});
} else { } else {