Skip to content
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

Medusa issue? - setting sales channels in middleware (req.query) not respected. #3

Open
MP70 opened this issue Nov 20, 2023 · 0 comments

Comments

@MP70
Copy link
Owner

MP70 commented Nov 20, 2023

When setting sales channels in middleware (req.query) a store/products 'GET' does not filter by those sales channels, however when sales channels are set in the original query at the users request, rather than in middleware, it DOES filter by those IDs. Believe our MW might be being called too late.

MW injects like this

 console.log("Before setting SchanID", req.query);
      req.query.sales_channel_id = filteredSalesChannelIds;
      console.log("After setting SchanID", req.query);
Screenshot 2023-11-20 at 15 09 22

Reproduce :
Only if not already done;
npm run seed
Then
npm run b2b-seed
This should leave you with

  • some products starting priv - attached to a new B2B sales Channel.
  • A B2B 'customer'
  • A B2B customer Group

Now Link the customer group to the sales channel
Screenshot 2023-11-20 at 15 16 27

Then you can run
npm run test

@MP70 MP70 changed the title Medusa issue? - setting sales channels in middleware (req.query) does not filter by those IDs, however when set in or Medusa issue? - setting sales channels in middleware (req.query) not respected. Nov 20, 2023
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

No branches or pull requests

1 participant