Skip to content

Make it easier to use backend filters #48

Description

@SpaceK33z

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');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions