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

Merge Filters when using performAction #56

Open
mjniday opened this issue Mar 7, 2018 · 0 comments
Open

Merge Filters when using performAction #56

mjniday opened this issue Mar 7, 2018 · 0 comments

Comments

@mjniday
Copy link
Contributor

mjniday commented Mar 7, 2018

Need some more input into how this would effect other use cases, but here is the one I just ran into:

Fetching a list of items, where I already have a resource set up with autoload: false, and in componentWillReceiveProps, I may fetch.

In cWRP:

collection.performAction('list', { filters: {'createdAt.after': 'yesterday'}})

Then I had a different component looking at the filters set on this collection

collection.filters.get('createdAt.after')
// undefined

performAction does not merge filters, so this was not being set

In this case, I just worked around it by using updateFilters. Since I don't need anything else on performAction, then the above call is equal to the following:

updateFilters({filters: {'createdAt.after': 'yesterday'}})
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