Skip to content

[api] Use of $.extend changes array response type into weird object #6604

Open
@Bouke

Description

@Bouke

[api] Use of $.extend changes array response type into weird object

Steps

  1. I have dropdown that uses an API that returns an array.
  2. In the onResponse I want to modify that array, e.g. using response.map(x => {...}).

Expected Result

  1. My onResponse method is passed an actual array, not a jQuery object.

Actual Result

  1. However as the datatype is 'json', the response is changed from an array into an object. I cannot do array operations like response.map and I have unwanted properties on the object, like _super.

? settings.onResponse.call(context, $.extend(true, {}, response))

Version

2.4

Testcase

Couldn't find a mock http server that returns an json array.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions