I am making a request to a 3rd api through my backend. The api returns an array of events to my frontend and I store them individualy in the ember DS. The route for my API request is eventful and the route/model I create an event for is eventful-event. My model hook for eventful-event is:
import Ember from 'ember';
export default Ember.Route.extend({
model () {
return this.get('store').findAll('eventful-event');
},
// events: this.get('store').findAll('eventful-event'),
});
and my route template is (I'm rendering here just to get it working. Eventually I'll pass to a component):
<p class='show-search-results'>
</p>
Nothing renders in the <p>
tag. I know the data is coming back and being stored as eventful-events because I can see it in my inspector.
For clarification, none of this data is being stored on the backend. Because of this I had to create a dummy endpoint on my backend so ember didnt crash when it tries to grab data from the model hook before a user performs a query. My goal is to have the user query the 3rd party api, store this data in ember DS, and then the user will select events they'd like to save and then I'd update the database with that.
Aucun commentaire:
Enregistrer un commentaire