-
Notifications
You must be signed in to change notification settings - Fork 5
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
Refactor: Routes for group specific vocab activation #94
Conversation
If have updated all routes, everything should work. I will just do some code cleanup and refactoring This is just a question for this temporarily setup. I would say we implement the full Custom Learning features later, as this is something like a test drive which will be available because it is made available through another function we built |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor change, otherwise code looks good.
Description
This PR will be the basis for the upcoming PR in the Frontend (issued here vocascan/vocascan-frontend#132).
I updated the routes to return groups and vocabs that contain staged vocabs.
Updated GET group route
GET
/api/languagePackage/:languagePackageId/group
Added query parameter
?onlyStaged=true
to only return groups that contain at least one unactivated/staged vocabAdded query parameter
?onlyActivated=true
to only return groups that contain at least one active vocabUpdated GET language package route
GET
/api/languagePackage/
Added query parameter
?onlyActivated=true
to only return language packages that contain at least one group with at least one active vocabUpdate GET query route
GET
/languagePackage/:languagePackageId/query
Add query parameter
?groupId={groupId}&groupId={groupId}
to return only vocabs from these groupAdd query parameter
onlyStaged=true
to return only vocabs that are stagedAdd query parameter
onlyActivated=true
to return only vocabs that are already activated(
groupId
query parameter can be combined with eitheronlyStaged
oronlyActivated
)Updated GET vocab group
GET
/api/group/:groupId/vocabulary
Added query parameter
?onlyStaged=true
to only return vocabs of a group that are already activated (for custom learning)Motivation and Context
The activate function was kind of useless, as you could just start a query that throws every inactivated/staged vocabs in a query. You couldn't decide which group you want to add to your daily query. With this PR i want to provide the backend basis to implement group specific vocab activation.
In addition to this this PR will give the basis to implement the upcoming "Custom Learning" functionality (issued here vocascan/vocascan-frontend#126
Screenshots / GIFs (if appropriate):
Checklist
Resolves
#93
vocascan/vocascan-frontend#126
vocascan/vocascan-frontend#132