Skip to content

Add support for Ember 4 #55

@byteg

Description

@byteg

In order to work with Ember 4 the method ajaxOptions should return FormData object in 'body' field instead of 'data'. Here is the code:

ajaxOptions: function (url, type, options) {
    var data;

    if (options && 'data' in options) {
      data = options.data;
    }

    var hash = this._super.apply(this, arguments);

    if (
      typeof FormData !== 'undefined' &&
      data &&
      this.formDataTypes.indexOf(type) >= 0
    ) {
      hash.processData = false;
      hash.contentType = false;
      if (typeof hash.headers !== 'undefined') {
        delete hash.headers['content-type'];
      }
      hash.body = this._getFormData(data);
    }
    return hash;
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions