Skip to content

[5.3.9] Builded url for this.store.query incorrect when passing include as array #9588

Open
@mkszepp

Description

@mkszepp

The this.store.query (legacy adapters) isn't working correctly when we pass includes as array.

this.store.query<Company>('company', {
  filter: {
    type: 'example',
  },
  include: ['ceo', 'employee'],
});

The query params result in url is: &include[]=ceo&include[]=employee

it should be &include=ceo,employee

This bug was fixed for findAll & findRecord in #9583

It was not fixed for query (maybe also other) because this.buildQuery will not be called inside that function

query(store: Store, type: ModelSchema, query: Record<string, unknown>): Promise<AdapterPayload> {
const url = this.buildURL(type.modelName, null, null, 'query', query);
if (this.sortQueryParams) {
query = this.sortQueryParams(query);
}
return this.ajax(url, 'GET', { data: query });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions