Code Monkey home page Code Monkey logo

Comments (10)

nlfurniss avatar nlfurniss commented on July 16, 2024

I'm a little confused by that bit. If contentType is set to anything, overwrite it and set it to application/vnd.api+json?

if (hash.contentType) {
  hash.contentType = 'application/vnd.api+json';
}

from ember-fetch.

kellyselden avatar kellyselden commented on July 16, 2024

That shouldn't be required though. The mixin should inherit the contentType from the adapter it's on (via a _super call).

from ember-fetch.

RobbieTheWagner avatar RobbieTheWagner commented on July 16, 2024

Just hit this issue as well. Anyone have a fix?

from ember-fetch.

webark avatar webark commented on July 16, 2024

https://github.com/ember-cli/ember-fetch/blob/master/addon/mixins/adapter-fetch.js#L127-L130

looks like this needs to get cleaned up. You could write your own mixin that extends this one, and overwrite the ajax options method.

from ember-fetch.

youroff avatar youroff commented on July 16, 2024

Not sure if this is this exact issue, but we can't make ember-fetch working with ember-simple-auth and jsonapi adapter. Seems like AdapterFetch mixin doesn't call this._super anywhere in ajaxOptions which doesn't let simple auth do its job. Proper content type is getting cleared out in our case too. Any ideas on workaround?

from ember-fetch.

webark avatar webark commented on July 16, 2024

@youroff might not be a bad idea to include. However, i think if you include ember-fetch mixin first in your application adapter, it shouldn’t overwrite. Id imagine that the mixins get called in the order you list them.

from ember-fetch.

youroff avatar youroff commented on July 16, 2024

Yeah, I tried to change the order, but it didn't help. Might be something else. I'll post here if I find anything.

from ember-fetch.

ChristopherConnock avatar ChristopherConnock commented on July 16, 2024

@youroff running into a similar error switching to ember-fetch (with a fully operational ember-auth app).

ember-auth's authorize is not called (order of mixins did not change anything)
export default DS.RESTAdapter.extend(AdapterFetch, DataAdapterMixin, {

ember-auth's authorize is called, but fetch is not leveraged
export default DS.RESTAdapter.extend(DataAdapterMixin, {

from ember-fetch.

youroff avatar youroff commented on July 16, 2024

@ChristopherConnock interesting, I thought it only affected JSONAPIAdapter. Anyways, we decided to put it on hold until fetch gets better support. So far even ember-data won't allow to ditch $.ajax completely if I get it right.

from ember-fetch.

tchak avatar tchak commented on July 16, 2024

I just want to mention that we are moving fetch support to Ember Data itself : emberjs/data#5386

from ember-fetch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.