feat: enhanced the get product endpoint with category filter#1222
Open
PeterOyelegbin wants to merge 10 commits intohngprojects:devfrom
Open
feat: enhanced the get product endpoint with category filter#1222PeterOyelegbin wants to merge 10 commits intohngprojects:devfrom
PeterOyelegbin wants to merge 10 commits intohngprojects:devfrom
Conversation
|
Pull from upstream and re-push |
phurhard
reviewed
Mar 2, 2025
| ''' | ||
|
|
||
| query = db.query(model) | ||
| if query is None: |
There was a problem hiding this comment.
when you set this condition what happens is query is not None?
PeterOyelegbin
commented
Mar 2, 2025
| ''' | ||
|
|
||
| query = db.query(model) | ||
| if query is None: |
Author
There was a problem hiding this comment.
If query is none, then it gets all products;
if query is not none, it gets the product related to that category.
|
When you push your PR, monitor it to ensure the checks pass |
fix: unit test
updated product.py
fix merge conflict
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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: