Skip to content

Commit

Permalink
added .then and .catch to code where results are saved
Browse files Browse the repository at this point in the history
  • Loading branch information
meierj423 committed Aug 24, 2020
1 parent 88b9ab8 commit 77c408c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions client/src/pages/Results/Results.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="container mt-4 p-4">
Expand Down Expand Up @@ -72,4 +78,4 @@ function Results(props) {
</div>
);
}
export default Results;
export default Results;

0 comments on commit 77c408c

Please sign in to comment.