Skip to content

feat: expose streak data in API response#350

Open
Yashaswini-K-P wants to merge 2 commits into
codepvg:mainfrom
Yashaswini-K-P:feat/api-streak-endpoint
Open

feat: expose streak data in API response#350
Yashaswini-K-P wants to merge 2 commits into
codepvg:mainfrom
Yashaswini-K-P:feat/api-streak-endpoint

Conversation

@Yashaswini-K-P

Copy link
Copy Markdown
Contributor

Description

This PR integrates the pre-computed streak data into the user profile API response. Instead of calculating streaks on-the-fly, the API now directly serves the streak object (containing current, longest, and lastUpdated values) directly from the persistent JSON storage. This ensures consistent data retrieval and improves response performance.

Linked Issue

Fixes #51

Changes Made

  • Updated fetchUserInfo.js to extract the streak object from the user's JSON data file.
  • Included the streak object in the returned user information object, ensuring it is accessible via the API.
  • Maintained backward compatibility for users who do not yet have the updated streak schema.

Type of Change

  • New feature
  • Refactor

Testing

  • Tested locally
  • Tested on mobile viewport (if applicable)
  • No console errors introduced

Checklist

  • My code follows the project's coding style
  • I have formatted my code locally by running npx prettier --write . before submitting
  • I am submitting my PR from a dedicated feature/* branch, not the main branch
  • I have performed a self-review of my code
  • My changes generate no new warnings or errors
  • I have updated documentation if required
  • I have linked the relevant issue

Screenshots / Screen Recording

N/A

@github-actions

Copy link
Copy Markdown
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

  • Please confirm you have formatted your code locally using npx prettier --write . before requesting a review.
  • Ensure this PR is made from a feature/* branch and not main.

Note: This project is currently maintained by a solo maintainer, so reviews and responses may sometimes take a little time. Thanks for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Add] Implement an Easy-to-Use Daily Challenge & Active Streak Indicator Card

1 participant