Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaderboard: hit the API #2

Merged
merged 8 commits into from Jun 15, 2022
Merged

Leaderboard: hit the API #2

merged 8 commits into from Jun 15, 2022

Conversation

bobb-Rob
Copy link
Owner

Implemented the following:

  • Created a new game using the API.
  • Implemented the "Refresh" button (receiving data from the API and parsing the JSON).
  • Add score form "Submit" button (sending data to the API).
  • Used async and await JavaScript features to consume the API.

Copy link

@Gambit142 Gambit142 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bobb-Rob 👋,

Your project is complete! There is nothing else to say other than... it's time to merge it :shipit:
Congratulations! 🎉

Highlights

  • The Submit button hits the POST API point✔️
  • The Refresh button hits the GET API point ✔️
  • Use of arrow functions ✔️
  • Use of async and await keywords along with the fetch function ✔️

Optional Suggestions

  • Kindly consider the optional suggestions. 👍

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.


As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.

src/index.js Outdated
Comment on lines 47 to 53
const score = document.querySelector('#score-input');

const newUserScore = {
user: name.value,
score: score.value,
};
Copy link

@Gambit142 Gambit142 Jun 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • [Optional] It would be nice to validate the name and score field so that a user won't be able to submit blank values. 👍

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Idea. I will do that right away. Thank you for this suggestion

src/index.js Outdated
Comment on lines 14 to 16
.then((data) => getId(data.result));

Copy link

@Gambit142 Gambit142 Jun 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • [Optional] Everything in the application works properly. However, it would be nice to use one gameId for your application. The reason I suggested this is that anytime I reload the page, all the scores are gone. This is because a new gameId is fetched anytime I reload the page. For a good user experience, it would be great to have one gameId. You can put instructions in the README.md file to guide users on how to generate a new gameId if a user wants to create a new game. 👍

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this issue

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bobb-Rob, great work 👏

@bobb-Rob
Copy link
Owner Author

@Gambit142 Thank you so much for the help. Kindly check to confirm I implemented all suggestions.

@bobb-Rob bobb-Rob merged commit 31ce436 into develop Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants