Pushing errors back to frontend
All checks were successful
Music Collection CI Workflow / test (./backend) (push) Successful in 34s
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 51s
Music Collection CI Workflow / build-and-push-images (./frontend/Dockerfile, git.anatid.net/tabris/music-collection-frontend, ./frontend) (push) Successful in 1m49s
Music Collection CI Workflow / deploy (push) Successful in 23s

This commit is contained in:
Phill Pover 2025-04-07 11:17:26 +01:00
parent 789d241769
commit 4335aaf85c

View File

@ -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);