From da2dadec1d3afb9d924ad22864559bacb9c08042 Mon Sep 17 00:00:00 2001 From: Phill Pover Date: Mon, 7 Apr 2025 11:31:23 +0100 Subject: [PATCH] Pushing errors back to frontend --- frontend/src/app/album/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/album/page.tsx b/frontend/src/app/album/page.tsx index 4883cf7..003309f 100644 --- a/frontend/src/app/album/page.tsx +++ b/frontend/src/app/album/page.tsx @@ -46,7 +46,7 @@ export default function Page() { const formData = new FormData(event.currentTarget); try { if (formData.get('id') == "") { - const result = createAlbum(formData) + const result = await createAlbum(formData) .then(response => { if (response.ok) { return response.json() @@ -56,7 +56,7 @@ export default function Page() { .catch(error => {return error.json()}); handleSnackbar(`Successfully updated Album with ID ${formData.get("id")}: ${result}`, true); } else { - const result = updateAlbum(formData) + const result = await updateAlbum(formData) .then(response => { if (response.ok) { return response.json()