ember-ajax icon indicating copy to clipboard operation
ember-ajax copied to clipboard

Does this addon work with ember octane versions ?

Open SandeepJoel opened this issue 2 years ago • 3 comments

Got the error "Could not find module jquery imported from ember-ajax/utils/ajax" while executing the below function call.

return this.ajax
.request('/api/token', {
  method: 'POST',
  // url: '/api/token',
  data: payloadData,
})
.then((result) => {
  return result.token;
})
.catch(function (error) {
  console.log('Api failure', error);
});

Doing ember install @ember/jquery seems to fix this issue. Why is this fix needed ?

SandeepJoel avatar Jun 27 '22 02:06 SandeepJoel

do you really want to know..? 🥴

webark avatar Jun 27 '22 03:06 webark

Atleast have we documented this somewhere in this repo ?

SandeepJoel avatar Jul 01 '22 15:07 SandeepJoel

https://github.com/ember-cli/ember-ajax/blob/5520bdf3561175f0a6b5827cd0c2d4b36dd2ef4f/addon/utils/ajax.ts#L1-L6

you can see here that it's just importing jquery to use as its ajax method.

Don't think it's documented anymore. There's an ember-ajax-fetch which has a very similar api but uses fetch.

webark avatar Jul 01 '22 23:07 webark