From 74b37f469d9f5c67fbc6eead46458a4a8ed7db69 Mon Sep 17 00:00:00 2001 From: Robbie Bise Date: Thu, 8 Feb 2024 12:49:32 -0600 Subject: [PATCH 1/2] add commented out code --- client/src/App.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/client/src/App.js b/client/src/App.js index ef3b475..b31cb0f 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -38,6 +38,24 @@ return body; }; + + // call new api + callTestApi = async () => { + console.log("Calling test API.."); + response = await fetch('/api/test'); + const body = await response.json(); + + if (response.status !== 200) + // // parse the error message + // message = JSON.parse(body.message); + + // // add timestamp to the error message + // message = message + " at " + new Date().toLocaleString(); + + throw Error(message); + + return body; + } handleSubmit = async e => { From 55488b9ebae26ddabebf763ce23ec838d665cda6 Mon Sep 17 00:00:00 2001 From: robbiebise <118204121+robbiebise@users.noreply.github.com> Date: Thu, 29 May 2025 12:58:49 -0500 Subject: [PATCH 2/2] Update App.js --- client/src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/App.js b/client/src/App.js index b31cb0f..e110708 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -49,7 +49,7 @@ // // parse the error message // message = JSON.parse(body.message); - // // add timestamp to the error message + // TODO: add timestamp to the error message // message = message + " at " + new Date().toLocaleString(); throw Error(message);