@teckays wrote:
I'm wondering if I need to extend the
DS.Store
class in order to add a query method likethis.store.search()
for example, would it be possible on the current version?This need comes from the fact that I have a
JSONAPIAdapter
-like backend API but with some minor changes. For example I have a custom route to perform searches on the model/{model}/search
and none of the existing methods,findAll()
,query()
and others help me achieve this functionality without overriding some of them which is not something I really like.The build-in
this.store.query()
method works great if I want to query on a specific model field, but forsearch()
I'm using atext
parameter which looks over multiple model fields to find a match.The best approach in my opinion would be to extend the
DS.Store
class and add athis.store.search()
method for example that would allow me to automatically search for records on any model.
Posts: 3
Participants: 2