This works well and the request sent to the server is GET /categories?filter[forum]=main. My app gets all the categories from the forum with ID main.
Now, instead of the previous request, I would like to make a GET /forums/main/categories from the model. How can this be done in Ember with Ember Data?
The request works and the correct data is returned from the server. But Ember Data just doesn’t know about it and I can’t use the model in my template. How can I make Ember AJAX work with Ember Data?
The Ember AJAX GitHub page proposes to write something like that:
import DS from 'ember-data';
import AjaxServiceSupport from 'ember-ajax/mixins/ajax-support';
export default DS.JSONAPIAdapter.extend(AjaxServiceSupport);
I have read about adapters, but I don’t think that’s this is what I’m looking for. (I might be wrong)
The request GET /forum/main/relationships is a valid JSON API request. Why can’t I use it with Ember Data?
Thank you for your example, but main is an ID and in your code example, you hard code the ID in the adapter. Somewhere else in my app, I might want to GET /forums/abc123/categories.