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

Fix [FreeCodeCampPoints] not found handling #10377

Merged
merged 2 commits into from
Jul 22, 2024

Conversation

PyvesB
Copy link
Member

@PyvesB PyvesB commented Jul 18, 2024

The API apparently now returns a nice 404 response code we can leverage.

@PyvesB PyvesB added the service-badge Accepted and actionable changes, features, and bugs label Jul 18, 2024
Copy link
Contributor

github-actions bot commented Jul 18, 2024

Warnings
⚠️ This PR modified service code for freecodecamp but not its test code.
That's okay so long as it's refactoring existing code.
Messages
📖 ✨ Thanks for your contribution to Shields, @PyvesB!

Generated by 🚫 dangerJS against 6c44021

})
}

static transform(response, username) {
const { entities } = response

if (entities === undefined)
Copy link
Member

@chris48s chris48s Jul 21, 2024

Choose a reason for hiding this comment

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

If we're removing this handling, we need to tighten up the schema and make sure the values we need are now required in the schema. At the moment the schema is written to accept bad values so we could handle the not found case like this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, thanks!

@PyvesB PyvesB added this pull request to the merge queue Jul 22, 2024
Merged via the queue into badges:master with commit 66d9f4d Jul 22, 2024
23 checks passed
@PyvesB PyvesB deleted the freecodecampoints-fix-not-found branch July 22, 2024 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants