-
Notifications
You must be signed in to change notification settings - Fork 213
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
feat: enhanced the get product endpoint with category filter #1222
base: dev
Are you sure you want to change the base?
feat: enhanced the get product endpoint with category filter #1222
Conversation
Pull from upstream and re-push |
@@ -61,7 +63,8 @@ def paginated_response( | |||
``` | |||
''' | |||
|
|||
query = db.query(model) | |||
if query is None: |
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.
when you set this condition what happens is query is not None?
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.
Ohkay, your test fails
@@ -61,7 +63,8 @@ def paginated_response( | |||
``` | |||
''' | |||
|
|||
query = db.query(model) | |||
if query is None: |
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.
If query is none, then it gets all products;
if query is not none, it gets the product related to that category.
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.
update your PR
When you push your PR, monitor it to ensure the checks pass |
fix: unit test
updated product.py
fix merge conflict
Summary
Update the GET /api/v1/products endpoint to include a filter by category parameter. This will allow users to retrieve products based on their category of interest.
Description
Related Issue (Link to issue ticket)
Feature Enhancement: To enable users to query products relevant to their category of interest while maintaining the existing functionality for unfiltered requests.
Issue Link
Motivation and Context
To enable users to query products relevant to their category of interest while maintaining the existing functionality for unfiltered requests.
How Has This Been Tested?
Screenshots (if appropriate - Postman, etc):
Unit test

Postman
When category is none:

When the category is not none:

Types of changes
Checklist: