make userProgressQuery to getProgressQuery #743
Merged
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.
Overview
This PR aims to refactor the existing
userProgressDetails
RTK query to make it more generic and reusable. The query will be renamed asgetProgressDetails
to support fetching progress details for both users and tasks.Changes Made
The following changes have been made to this pull request:
userProgressDetails
RTK query to make it generic and renamed it togetProgressDetails
.userProgressDetails
to use the newgetProgressDetails
query.getProgressDetails
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 thegetProgressDetails
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: