You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use case: I have a /api/users/:user_id resource that serves up relevant JSON about users of my system. I also make use of the session store to keep track of which user_id the current user is logged in as, and serve that up as /api/users/current.
The user object JSON includes an id field, but either because the id in the API path (which I retrieve by doing a @session.find 'user', 'current') is a string, or doesn't match the actual id field in the returned JSON, the system chokes with an error.
There are several options for doing this. Soon I would like to officially support urls for collections and models, but for now I would use a remoteCall: session.remoteCall('user', 'current'). This should load that 'api/users/current' endpoint and load whatever data is serialized back. (there might be an issue with GET requests and remoteCall but I can easily fix if that is the case.)
session.remoteCall('user','current') does indeed use POST to get to api/users/current, but I was able to provide a post route there. However, the returned object still gives an error in the same place.
Use case: I have a /api/users/:user_id resource that serves up relevant JSON about users of my system. I also make use of the session store to keep track of which user_id the current user is logged in as, and serve that up as /api/users/current.
The user object JSON includes an id field, but either because the id in the API path (which I retrieve by doing a @session.find 'user', 'current') is a string, or doesn't match the actual id field in the returned JSON, the system chokes with an error.
Uncaught TypeError: Cannot call method 'toString' of undefined epf.js?body=1:2765
Ep.Adapter.Ember.Object.extend._typeToString epf.js?body=1:2765
Ep.Adapter.Ember.Object.extend._generateClientId epf.js?body=1:2762
Ep.Adapter.Ember.Object.extend.reifyClientId epf.js?body=1:2750
Ep.Session.Ember.Object.extend.reifyClientId epf.js?body=1:3322
Ep.Session.reopen.merge epf.js?body=1:2980
(anonymous function) epf.js?body=1:3251
invokeCallback ember.js?body=1:7252
(anonymous function) ember.js?body=1:7302
EventTarget.trigger ember.js?body=1:7075
(anonymous function) ember.js?body=1:7365
DeferredActionQueues.flush ember.js?body=1:4727
Backburner.end ember.js?body=1:4813
(anonymous function)
The text was updated successfully, but these errors were encountered: