Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mkszepp opened this issue Nov 6, 2024 · 0 comments

Comments

@mkszepp
Copy link
Contributor

mkszepp commented Nov 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: needs triage
Development

No branches or pull requests

1 participant