From 829be77322f960f922644937ab9bb108e503c695 Mon Sep 17 00:00:00 2001 From: MgenGlder Date: Sat, 27 Dec 2025 16:46:03 -0500 Subject: [PATCH] fix: Parse json payload from `v2/notes` API: --- src/pages/Notes.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/Notes.tsx b/src/pages/Notes.tsx index f873914..f92f439 100644 --- a/src/pages/Notes.tsx +++ b/src/pages/Notes.tsx @@ -57,7 +57,7 @@ const Notes: React.FC = () => { const fetchMessage = async (): Promise => { try { const response = await fetch( - "https://api.dearborncodingclub.com/notes/", { + "https://api.dearborncodingclub.com/v2/notes/", { method: "GET", headers: { "Content-type": "application/json; charset=UTF-8", @@ -68,8 +68,8 @@ const Notes: React.FC = () => { if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`) } - const data: ServerResponse = await response.json() - setMessage(data.message) + const data = JSON.stringify(await response.json()) + setMessage(data) } catch (e) { setError(e instanceof Error ? e.message : "An unknown error occurred") console.error("Error fetching message:", e)