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

pushToStore Array vs Object Mismatch #52

Open
CharlesKozel opened this issue Nov 1, 2018 · 0 comments
Open

pushToStore Array vs Object Mismatch #52

CharlesKozel opened this issue Nov 1, 2018 · 0 comments

Comments

@CharlesKozel
Copy link

Code Block I'm Referencing

In the _onSuccess handler, when pushToStore is true, this._validResponse(response) ensures the response is an object with > 0 keys. However later on when this.get('serializer').normalizeArrayResponse is called with response as the payload.

normalizeArrayResponse's payload is expected to be an array, when previously is was required to be an object. With the standard JsonSerializer it errors with an object is provided, and does not go into this block when an array is provided as the response.

Is normalizeArrayResponse intended to be normalizeSingleResponse? Which would make more sense to me when operating on a single record, I would think custom actions would usually return an updated version of that object.

Maybe it should check the type and normalize as a SingleResponse or an ArrayResponse based on type, so custom search actions can still return an array.

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

No branches or pull requests

1 participant