Feature/add global ranking#120
Open
Yashaswini-K-P wants to merge 6 commits 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. A maintainer will review your submission shortly. |
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
/api/student/:usernameendpoint by adding the user's live LeetCode Global Ranking to the API response payload.Previously, while problem metrics were tracked historically via GitHub repositories, the absolute global leaderboard ranking was not exposed to the student profile layout. This change fetches the most recent global ranking dynamically from the LeetCode API, updates the response body structure gracefully, and implements zero-value fallbacks if the upstream service is unreachable—ensuring complete backward compatibility.
Linked Issue
Fixes #92
Changes Made
fetchStudentHistoryto initially hit theleetcode-api-dun.vercel.appwrapper to capture the live, un-mutatedrankinginteger on-demand.rankingparameter to0or retrieve it sequentially from historical repositories if the upstream wrapper times out or fails.rankingkey directly alongsideusernameandhistorydata to align with frontend consumption criteria.Type of Change
Testing
Checklist
Screenshots / Screen Recording