Skip to content

pushToStore Array vs Object Mismatch #52

@CharlesKozel

Description

@CharlesKozel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions