I want to fill up multiple drop-down from API like below where i have to pass type parameter like ‘department’,‘priority’ etc. It didn’t return expected result as using one model ‘lookup’ for multiple calls.Sometime returns data of both department and some time priority data only and other department drop-down does not have any record.
model(){
var _this=this;
return Ember.RSVP.hash({
status: _this.fetchLookup(‘department’),
priority: _this.fetchLookup(‘priority’),
});
},
fetchLookup(type) {
return this.store.query(‘lookup’, {
LookupType: type
});
}
Thanks for your response broerse i am trying to load one model ‘lookup’ multiple times in model hook. I have analyzed the implementation again and
found that issue is occurring because API is returning id field
same(start from 1 to rows count) for each lookup calls. There is only
one model ‘lookup’ hence in store it update and insert data accordingly.
That’s why dirty record appears in drop down. There is any way to clear
store before call as these are async requests that’s why UnloadAll also
didn’t work?