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

make userProgressQuery to getProgressQuery #743

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

RitikJaiswal75
Copy link
Contributor

Overview

This PR aims to refactor the existing userProgressDetails RTK query to make it more generic and reusable. The query will be renamed as getProgressDetails to support fetching progress details for both users and tasks.

Changes Made

The following changes have been made to this pull request:

  • Refactored the userProgressDetails RTK query to make it generic and renamed it to getProgressDetails.
  • Updated all references to userProgressDetails to use the new getProgressDetails query.
  • Added comprehensive unit tests to validate the correctness and versatility of the getProgressDetails query.
  • Updated documentation and examples to reflect the changes and provide guidance on using the new query.

Reasoning

The original userProgressDetails query was designed specifically for retrieving user progress details, which limited its applicability. By making it more generic, we can now use the getProgressDetails query to fetch progress details for both users and tasks, reducing code duplication and improving maintainability.

Testing

We have added extensive unit tests to cover various scenarios for the getProgressDetails query. The tests validate the behavior of the query for both user progress and task progress cases, ensuring its correct functionality in any usage scenario.

How to Test

To test the changes made in this pull request, follow these steps:

  1. Checkout this branch locally.
  2. Run the test suite using the following command:

@vercel
Copy link

vercel bot commented Jul 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
status-app ✅ Ready (Inspect) Visit Preview Jul 20, 2023 9:27am

@RitikJaiswal75 RitikJaiswal75 self-assigned this Jul 20, 2023
src/app/services/api.ts Show resolved Hide resolved
@RitikJaiswal75 RitikJaiswal75 merged commit cc98b26 into develop Jul 21, 2023
2 checks passed
@RitikJaiswal75 RitikJaiswal75 deleted the fix/change-userProgressRtk-to-progressRtk branch July 21, 2023 04:30
@RitikJaiswal75 RitikJaiswal75 mentioned this pull request Jul 21, 2023
10 tasks
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.

4 participants