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

Be forgiving with include array #154

Open
ryanto opened this issue Aug 7, 2019 · 1 comment
Open

Be forgiving with include array #154

ryanto opened this issue Aug 7, 2019 · 1 comment
Labels

Comments

@ryanto
Copy link
Member

ryanto commented Aug 7, 2019

Technically, includes should be a string.

store.loadAll('posts', { include: 'comments,author' });

However, I've come across times in the real world when it's passed an array.

store.loadAll('posts', { include: ['comments', 'author'] });

While this is incorrect, it's something we can correct. Currently, storefront will error with a hard to read stack trace from deep in library when it tries to use a string method on the array.

As a fix, if we come across an includes array we should correct it by running [].join(',')

@ryanto ryanto added the Bug label Aug 7, 2019
@lagatun54
Copy link

everything works

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

No branches or pull requests

2 participants