From 77c408cdc0649f16a91be73f28e71834ea29c9ca Mon Sep 17 00:00:00 2001 From: Jack Meier Date: Mon, 24 Aug 2020 13:01:40 -0700 Subject: [PATCH] added .then and .catch to code where results are saved --- client/src/pages/Results/Results.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/src/pages/Results/Results.js b/client/src/pages/Results/Results.js index 468e4d9..9d1aac5 100644 --- a/client/src/pages/Results/Results.js +++ b/client/src/pages/Results/Results.js @@ -40,7 +40,13 @@ function Results(props) { let results = {}; results[continent] = score; - API.saveResult(user.id, results); + API.saveResult(user.id, results) + .then((res) => { + console.log("Results saved successfully"); + }) + .catch((err) => { + console.log(err); + }); }, [user.id, score]); return (
@@ -72,4 +78,4 @@ function Results(props) {
); } -export default Results; \ No newline at end of file +export default Results;