Skip to content

Only query in-stock products #7163

Answered by radoslaw-sz
stephanboersma asked this question in Q&A
Discussion options

You must be logged in to vote

hi @stephanboersma - it is not possible out of the box, but you can do such things:

  1. Catch the request via https://docs.medusajs.com/development/api-routes/add-middleware
  2. Create your own API endpoint which will execute raw query based on your implementation of inventory_quantity
  3. Forward the request caught by 1) and forward it to the 2)

Probably it shall work.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@stephanboersma
Comment options

Answer selected by stephanboersma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants