Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

// TODO: add timestamp to the error message
// message = message + " at " + new Date().toLocaleString();

throw Error(message);

return body;
}


handleSubmit = async e => {
Expand Down