Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4836

Add DS.Store base delegate method to the adapter

$
0
0

@teckays wrote:

I'm wondering if I need to extend the DS.Store class in order to add a query method like this.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 for search() I'm using a text 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 a this.store.search() method for example that would allow me to automatically search for records on any model.

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4836

Trending Articles