From 5024ad4324d6a6401bfb6d4b563b013a9e6a6d3a Mon Sep 17 00:00:00 2001 From: Tim Howitz Date: Fri, 6 Jun 2025 18:25:35 +0100 Subject: [PATCH] Added Payment Failed text on shop purchase fail --- src/app/shop/page.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/shop/page.tsx b/src/app/shop/page.tsx index 684ba10..27c73d6 100644 --- a/src/app/shop/page.tsx +++ b/src/app/shop/page.tsx @@ -295,7 +295,6 @@ export default function Shop() { "#" + Math.random().toString(24).substring(2, 10).toUpperCase() + new Date().toLocaleDateString("en-GB"); const orderNum = genOrder(); - // todo add display of error (async () => { try { const response = await axios.post("/api/shop/purchase", { @@ -309,8 +308,8 @@ export default function Shop() { setShowThankYouModal(true); setCart((c) => c.filter((a) => !artefactsToBuy.map((x) => x.id).includes(a.id))); } catch (error) { + setError("Payment Failed"); console.error("Error posting artefacts:", error); - throw error; } })(); }