Skip to content

filtering #270

@lbertidrwolf

Description

@lbertidrwolf

Hello, on my BackEnd I am using elide.io, I didn't find a way to apply elide filters with findAll.For example if I want to filter using filter[book]=genre=='Science Fiction';title==The*
What should be in this case the second argument of the findAll method of JsonApiDatastore?
using a json like

filter: {
          genre: 'Science Fiction',
          title:'The*'
        },

doesn't work and if I pass a string like 'filter[book]=genre=='Science Fiction';title==The*'
this will not appear in the url as query param.

The only way I found to have it working is to override the toQueryString method in the DatastoreConfig

const config: DatastoreConfig = {
  baseUrl: '/jsonapi',
  models: {
    ....
  },
  overrides:
  {
    toQueryString: (params: any) => params ? params.toString() : ''
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions