Im working on ember-cli, how do i change rest call on fly in the rest adapter. If i use path params not query params?for example:
export default DS.RESTAdapter.extend({
namespace:'res/v1/users/id',
pathForType: function() {
return Ember.String.underscore("friends");},});
Based on the user selection from dropdown we get the "id", using the id I need to get user friends from the database. Could you please suggest a better way to do. My aapplication supports pathparams not the query params
I have created a variable in enviroment.js 'userId'. When ever i select a user i set config.userId in the controller to the corresponding Id.
In pathforType of adapter I used this varible
you just need to add an import statement
Please suggest me if anyone get to know better way. Thanks all for your responses