Refactor platform/offered_by filtering and serialization for search #240
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.
What are the relevant tickets?
Closes #237
Closes #113
Partially addresses #199
Description (What does it do?)
LearningResourcePlatform.platform
toLearningResourcePlatform.code
code
property when filteringHow can this be tested?
Run
docker compose up
, some db migrations will runRun
./manage.py recreate_index --all
If you haven't already, run the following mgmt commands:
Try the following URL's they should all work and filter by the specified offeror/platform correctly. The total number of results should be the same, though the order will likely differ unless you add a sortby option.
http://localhost:8063/api/v1/learning_resources/?platform=mitxonline
http://localhost:8063/api/v1/learning_resources_search/?platform=mitxonline
http://localhost:8063/api/v1/learning_resources/?offered_by=mitpe
http://localhost:8063/api/v1/learning_resources_search/?offered_by=mitpe
Check the schema documentation, the codes and values for platform, offered_by, department, and resource type should be documented for both the db and opensearch endpoints.
http://localhost:8063/api/v1/schema/redoc/#tag/learning_resources
http://localhost:8063/api/v1/schema/redoc/#tag/learning_resources_search