#Overriding the prepareListQuery method
9 messages · Page 1 of 1 (latest)
By reading the doc 🤔https://adrien2p.github.io/medusa-extender/#/?id=override-method-that-use-buildquery ahah, joking
The extender provides an out-of-the-box application architecture which allows developers and teams to create highly testable, scalable, loosely coupled, and easily maintainable applications.
In also increase medusa extensibility and customisation for special use cases. It comes with handy
decorators approach to increase the DX and full typings s...
You can prepare your selector instead of doing it during or after
perfect thanks
im trying to fetch the products of the currently logged in user .... when i send a get request to admin/products i still get all the products rather than it being specific to a user.... i put some consolelogs in the preparelistquery and prepareselectorconfig methods to confirm they are being called but they dont show up...dont know if im writing it correctly... but this is from the docs
Because the name is incorrect, it is prepareListQuery_
You can see that by looking the product service. What I often say, if you want to customise something wothin the core, you have to be able to look at the implementation and understand what you are trying to change. The risk without doing that is that I give you all the answers but you will never understand the why behind
yh iv been doing that ...but you know there'd be some gotchas lol...interesting implementation decisions too 🙌
Yes indeed 😊 I invite you to look around the service to see how it works and get a better idea of what you need to do. I suggest to do as less as possible override of the methods in favour (when possible) to just intercept and mutate the arguments . That way it is easier to upgrade and follow the changes