feat: include contest data in user info API response#254
Open
Yashaswini-K-P wants to merge 1 commit into
Open
Conversation
Contributor
|
Thank you for submitting a pull request. Please ensure your changes comply with the project's contribution guidelines and that all workflow checks pass successfully. Formatting and Branching
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR extends the
fetchUserInfoutility function to capture and return the complete contest data object from the upstream LeetCode API wrapper. This allows the backend to expose competitive programming metrics (such as contest rating, global ranking, badges, and percentiles) via the/api/user/:usernameendpoint, setting up the required data foundation for the frontend profile update.Linked Issue
Fixes #192
Changes Made
fetch-user-info.jsto initialize and extract thecontestdata object fromliveApiUrl.contestobject to the final returned payload of thefetchUserInfofunction.|| null) to ensure graceful execution for users with no contest history.Type of Change
Testing
/api/user/:usernameroute with an active contest participant's username. Verified that the JSON response now completely returns the nestedconteststructure containing rating, rank, total participants, top percentage, count, and badge.Checklist
npx prettier --write .before submittingfeature/*branch, not themainbranchScreenshots / Screen Recording