in bangazonapi/views/product.py line 274, updated the sold_product filter so that if the user-entered number_sold is greater than or equal to (was less than or equal to) the number of each product sold, it will return those products at both http://localhost:8000/products?number_sold=20 (20 for ex.) as well as when using the filter input on the client site
Requests / Responses
If this PR contains code that defines a new request/response, or changes an existing one, please put the JSON representations here.
Request
GET /products?number_sold=2 displays all products that have been sold 2 or more times:
## Testing
Description of how to test code...
- using Postman, go to the "Products" folder of "Collections" and visit the "GET products that have sold 2 or more" file.
- perform the GET and compare results against your DB; attempt with other (relevant to your DB) numbers (1, 2, 3, 4, etc.)
- log into the client site and navigate to the "Filter Products" box; enter "2" into the "products sold" box, click "Filter," and check results against DB
## Related Issues
- Fixes #38
Description of PR that completes issue here...
Changes
Requests / Responses
If this PR contains code that defines a new request/response, or changes an existing one, please put the JSON representations here.
Request
GET
/products?number_sold=2
displays all products that have been sold 2 or more times:Response
HTTP/1.1 200 OK