Skip to content

Commit

Permalink
Merge pull request #373 from Gaurav0/specify_user_on_retrieving_twiddles
Browse files Browse the repository at this point in the history
Specify api user when retrieving twiddles
  • Loading branch information
Gaurav0 committed Mar 28, 2016
2 parents 311ff91 + 7cb9a4a commit 07cb461
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
12 changes: 12 additions & 0 deletions app/adapters/gist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import ApplicationAdapter from './application';

export default ApplicationAdapter.extend({
urlForQuery: function(query) {
const host = this.host || "";
if (query.user) {
return `${host}/users/${query.user}/gists`;
} else {
return `${host}/gists`;
}
}
});
5 changes: 4 additions & 1 deletion app/twiddles/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ export default Ember.Route.extend({
},

model() {
return this.get('store').query('gist', { per_page: 100 });
return this.get('store').query('gist', {
user: this.get('session.currentUser.login'),
per_page: 100
});
},

actions: {
Expand Down

0 comments on commit 07cb461

Please sign in to comment.