json - Error while loading route: Error: Assertion Failed: The response from a findAll must be an Array, not undefined -
I am getting the following error in my console when trying to return results from the JSON API:
Error on loading route: Error: Prohibition failure: Reaction from search: All should be an array, should not be undefined
My JSON API (see image) in amber data / P>
Also my code Any error Person is not thrown.
Any thoughts?
Amber APP:
App = Ember.Application.create (); App.ApplicationAdapter = DS.RESTAdapter; App.ApplicationAdapter = DS.RESTAdapter.extend ({url: 'http://127.0.0.1:3000', Namespace: 'API'}); App.ApplicationSerializer = DS.RESTSerializer.extend ({primaryKey: '_id'}); App.Store = DS.Store.extend ({Research: 11, Adapter: 'App.Adapter'}); DS.TRR ('string'), "shortname": DS.ETR ('string'), app.users = ds.model. Adend ({"first name": DS.ttr ('string'), "second name" DS.attr ('string'), "group": DS.attr ('string'), "charisma": DS.attr ( 'String'): "email address": DS.attr ('string'), "password" DS.attr ('string'), "dexterity": DS.attr ('string'), "userType": DS. ('String'), "log": DS.attr ('string'), "log in": DS.attr ('string DS.attr ('string')}); DS.ttr ('string'), "shortname": DS.ttr ('string'), app.user = ds.model.eded ( {"First name": DS. ATR ('string'), "second name" DS.attr ('st DS.attr ('string'): "email address": DS.attr ('string'), "password", DS.attr ('string'), "password": DS.attr ('string'), "charisma" DS.attr ('string'), "userType": DS.attr ('ds.tter (' string '), "__v": DS.attr (' string '), "Login indet": DS.attr ('string'), "log in": DS.attr ('string'), "dateRegistered": DS.attr ('string')}; App.Router.map (function () {// keep your routes here}}; App.IndexRoute = Ember.Route.extend ({renderTemplate: function () {this.render (); This.render ('nav', {outlet: 'nav'});}, model: function () {return it .store.find ('user');}}); "" "User": "{" First name ":" Barnes "," Second name ":" Bergstrom "," Shortnem ":" 4, "Focus: 3," Strength ": 3," Dexterity ":" "," Email Address ":" ARTPOP "," PRPOP "," Group ": 1," Charisma ": 1," UserType ": 1," DressType ": 2," Tile Type ": 1," _id " : "5302604A1a 41219A2D2072eb", "__v": 0, "Log InDate": "2014-02-17T19: 17: 34.725Z", "Login": False, "Dated": "2014 -02-17T19: 17: 34.724Z "}, {" First name ":" Lamar "," Second name ":" Schneider "," Short name ":" August 2, "Focus: 3," Strength ": 1, "Dexterity": "Strong", " Mail address ":" sandra@dolores.biz "," password ":" PJPKK "," group ": 0," charisma ": 2," usertip ": 1," dress type ": 2," skin type ": 2 , "_id": "5302604A1a 41219A2D2072AC", "__V": 0, "LogIndate": "2014-0 2-17T19: 17: 34.728Z", "Login": False, "dateRegistered": "2014-02-17T19: 17: 34.728Z"}}
Unless you need a user model for something else, I'll remove it and use only the user model and change this code:
app.indexrutte = amber way. Extension ({RenderTemplate: Function () {this.render (); this.render ('nav', {outlet: 'Nav'});}, Model: function () {return.store.find ('user') ; // changed in user}});
This will return an array of users and work should be done.
Also note that your user model is incorrect since users have an array of users, so it does not need to include all user properties. This should be a property - the user should see the model here:
App.Users = DS.Model.extend ({User: DS.hasMany ('user')})
Comments
Post a Comment