Skip to content

Commit 1291a87

Browse files
authored
Merge pull request #834 from Turbo87/fix-find-ids
Use queryRecord() instead of find()
2 parents d5ebc8b + b614c33 commit 1291a87

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

app/adapters/team.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import ApplicationAdapter from './application';
2+
3+
export default ApplicationAdapter.extend({
4+
queryRecord(store, type, query) {
5+
let url = this.urlForFindRecord(query.team_id, 'team');
6+
return this.ajax(url, 'GET');
7+
},
8+
});

app/adapters/user.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import ApplicationAdapter from './application';
2+
3+
export default ApplicationAdapter.extend({
4+
queryRecord(store, type, query) {
5+
let url = this.urlForFindRecord(query.user_id, 'user');
6+
return this.ajax(url, 'GET');
7+
},
8+
});

app/routes/team.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default Ember.Route.extend({
1919
model(params) {
2020
const { team_id } = params;
2121

22-
return this.store.find('team', team_id).then(
22+
return this.store.queryRecord('team', { team_id }).then(
2323
(team) => {
2424
params.team_id = team.get('id');
2525
return Ember.RSVP.hash({

app/routes/user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default Ember.Route.extend({
1212

1313
model(params) {
1414
const { user_id } = params;
15-
return this.store.find('user', user_id).then(
15+
return this.store.queryRecord('user', { user_id }).then(
1616
(user) => {
1717
params.user_id = user.get('id');
1818
return Ember.RSVP.hash({

0 commit comments

Comments
 (0)