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

Create a converter/mapper to the API #16

Open
willianjusten opened this issue Feb 4, 2022 · 1 comment
Open

Create a converter/mapper to the API #16

willianjusten opened this issue Feb 4, 2022 · 1 comment
Labels
enhancement New feature or request Logic

Comments

@willianjusten
Copy link
Owner

The API has some stuff that is not so meaningful like ta, tc and so on, it would be interesting to create a mapper like:

teamName: tn,
teamCity: tc,
teamAcronym: ta

This would help our code to be more readable.

@willianjusten willianjusten added Logic enhancement New feature or request labels Feb 4, 2022
@willianjusten willianjusten added this to the MVP 1 - Show info milestone Feb 5, 2022
@jdrgoms jdrgoms self-assigned this Feb 12, 2022
@willianjusten willianjusten removed this from the MVP 1 - Show info milestone Feb 23, 2022
@willianjusten
Copy link
Owner Author

A place that we would benefit having a mapper:

// TODO: Move this to a mapper function
return {
game: {
// This is needed because the NBA API returns the date separated
startTimeUTC: new Date(`${game.gdtutc} ${game.utctm} UTC`),
period: game.p,
clock: game.cl,
status: Number(game.st),
vTeam: {
score: game.vls.s,
triCode: game.vls.ta,
...game.vls,
},
hTeam: {
score: game.hls.s,
triCode: game.hls.ta,
...game.hls,
},
},
requestInfo,
}
}

@jdrgoms jdrgoms removed their assignment Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Logic
Projects
None yet
Development

No branches or pull requests

2 participants