Skip to content

Add in_stock_only parameter to /products endpoint #823

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

seer-by-sentry[bot]
Copy link
Contributor

👋 Hi there! This PR was automatically generated by Autofix 🤖

This fix was triggered by [email protected].

Fixes FLASK-38. The issue was that: TypeError occurred because product_inventory was None when in_stock_only was true, and code attempted membership check on None.

  • Added get_all_inventory function to db.py to retrieve all inventory items from the database.
  • Added in_stock_only parameter to the /products endpoint in main.py.
  • If in_stock_only is true, only products with a count greater than 0 in the inventory are returned.
  • If there is an error retrieving the inventory, an empty list is returned.

If you have any questions or feedback for the Sentry team about this fix, please email [email protected] with the Run ID: 43898.

Copy link

vercel bot commented May 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
empower ⬜️ Ignored (Inspect) Visit Preview May 16, 2025 5:45pm

Copy link

sentry-io bot commented May 16, 2025

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: flask/src/db.py

Function Unhandled Issue
get_inventory DatabaseConnectionError: get_inventory checkout
Event Count: 17

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants