Skip to content

Filter with String Array #73

Open
Open
@MLDMoritz

Description

@MLDMoritz

If you try to filter for array items it handles the parameter as an Object, which it isn't.

Example: CarModel.dispatch('fetch', { filter: { carMake_slug_list: 'audi' }}) works fine while CarModel.dispatch('fetch', { filter: { carMake_slug_list: ['audi', 'bmw'] }}) doesn't.

I got it working with catching the following part (which isn't the solution) in the transformer.ts:

try {
  const arrayModel = context.getModel(singularize(key));
  returnValue[key] = value.map(v => this.transformOutgoingData(arrayModel || model, v));
} catch (e) {
  returnValue[key] = value;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions