Skip to content

Commit b614c33

Browse files
committed
routes/team: Use queryRecord() instead of find()
find() expects to get a record with the same ID that was passed in, but in this case we're passing in a string (login) and receiving a numeric ID
1 parent 939c9f8 commit b614c33

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
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/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({

0 commit comments

Comments
 (0)