Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Storefront query with reference objects #146

@ryanto

Description

@ryanto

You can pass objects by reference to ember data queries, so you can so something like...

this.store.loadRecords('post', { filter: { slugs: ['post-1', 'post-2'] } })

and the backend is going to get an array of slugs that it can use to filter

there's an issue where if storefront gets a mutable array, that array can be mutated, and internally change so the query ends up not reflecting the data

this.store.loadRecords('post', { filter: { slugs: this.queryParams.slugs } })

now as slugs get added and removed from some controller action, that same array is used in the query.


The fix here is to copy/clone reference objects that are passed to storefront.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions