Sometimes you want to fetch a store from the backend but with some filters applied.
Our Django-Binder stack has a lot of auto-generated filters. To filter a store on a customer id we can do something like this:
const store = new Store();
store.params = {'.customer': customer.id };
store.fetch();
For a customer filter the backend has defined it looks about the same;
const store = new Store();
store.params = {'.leaves_for_customer': customer.id };
store.fetch();
The syntax for defining this is a bit weird + doesn't use camelCasing. We can perhaps fix it to look like this;
store.addFilter('leavesForCustomer', customer.id);
store.removeFilter('leavesForCustomer');
Sometimes you want to fetch a store from the backend but with some filters applied.
Our Django-Binder stack has a lot of auto-generated filters. To filter a store on a customer id we can do something like this:
For a customer filter the backend has defined it looks about the same;
The syntax for defining this is a bit weird + doesn't use camelCasing. We can perhaps fix it to look like this;