FirebaseExtended / FirebaseExtended/firestore-leaderboards-codelab

Mistake in params order in the code lab

Open
#9 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5
Forks
6
PR merge metrics
No merged PRs in 30d

Description

In functions/index in the addScore function we can see the following call:
helpers.createScore(user, score, admin.firestore())

First argument is user, the second one is score. But in the code lab we can see the following implementation of the createScore function:
async function createScore(score, playerID, firestore) {
return firestore.collection("scores").doc().create({
user: playerID,
score: score,
});
}

As you see here the first argument is score and the second one is playerID. Please, correct the codelab example code like so it will look like this:
async function createScore(playerID, score, firestore) {

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.