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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Leaderboard API functionality #2

Merged
merged 5 commits into from Jan 27, 2022
Merged

Conversation

Nicolaswg
Copy link
Owner

Main point

馃

In this new PR, we implement API async functions for Posting and Getting Data which is displayed dynamically inside the dom.

Change Made 鉁忥笍

  • New es6 module function
  • Post and Get API method

Copy link

@TedLivist TedLivist left a comment

Choose a reason for hiding this comment

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

STATUS: CHANGES REQUIRED 鈾伙笍 鈾伙笍

Hi @Nicolaswg,

Good job so far!
鉁旓笍 Nice idea with the video in README
鉁旓笍 Good idea with the creation of new game on page reload - makes UI look neat.
鉁旓笍 Use of arrow functions
However, there are some issues that you still need to work on to go to the next project but you are almost there!

Required Changes 鈾伙笍

Check the comments under the review.

Cheers and Happy coding!馃憦馃憦馃憦

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.

Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.


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.

@@ -1,18 +1,16 @@
# LeaderBoard-Project

Choose a reason for hiding this comment

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

  • In your README documentation, kindly include instructions on how users can set up your app locally.
  • Also include commands on how to install packages (npm install) and run the app (npm start or npm run build). This can be of great help to users

Comment on lines -1 to -31
import Score from './scores.js';

const AddScore = () => {
const name = document.getElementById('name');
const score = document.getElementById('score');
const index = Score.scoreList.length + 1;
if (name.value === '' || score.value === '') {
return null;
}
const newList = new Score(name.value, score.value, index);
Score.scoreList.push(newList);
name.value = '';
score.value = '';
return Score.scoreList.length;
};

const Render = () => {
const leaderBox = document.querySelector('.leaderboard-box');
if (Score.scoreList.length === 0) {
leaderBox.innerHTML = 'No new Score Added';
} else {
let html = '';
Score.scoreList.forEach((score) => {
html += `<li class="score"><p class="name">${score.name}: ${score.score}</p></li>`;
});
leaderBox.innerHTML = html;
}
return Score.scoreList.length;
};

export { AddScore, Render };
Copy link

@TedLivist TedLivist Jan 27, 2022

Choose a reason for hiding this comment

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

  • Let's keep our codebase clean. Kindly remove this empty and unused file.

    nico-add

Copy link
Owner Author

Choose a reason for hiding this comment

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

Oh.. sorry for that I did not check it 馃槩. Thanks for your feedback 馃憤

Copy link

@BrianSammit BrianSammit left a comment

Choose a reason for hiding this comment

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

STATUS: APROVED 馃煝 馃憦

Hello @Nicolaswg,
Your project is complete! There is nothing else to say other than... Great job 馃憦
Congratulations! 馃帀

Now you can merge this branch and move on 馃
HAPPY CODING AND GOOD LUCK WITH THE COMMING ONES 馃 馃崁

Well-Done-Applause

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.


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.

@Nicolaswg Nicolaswg merged commit e5f29fb into develop Jan 27, 2022
@Nicolaswg Nicolaswg deleted the feature/ft-api-hit branch January 27, 2022 01:55
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

3 participants