Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use include and filter params from endpoints adapter #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions app/adapters/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import adapter from 'ember-data-endpoints/adapter';

export default adapter.extend({
host: '',
queryParams: {
include: 'chapters',
filter: {
published_after: '1990-01-01'
}
}
});
8 changes: 1 addition & 7 deletions app/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ import Ember from 'ember';

export default Ember.Route.extend({
model: function() {
return this.store.find('book', {
include: "chapters",
//'filter[published_after]': '1990-01-01'
filter: {
published_after: '1990-01-01'
}
});
return this.store.find('book');
}
});
12 changes: 12 additions & 0 deletions tests/unit/adapters/index-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { moduleFor, test } from 'ember-qunit';

moduleFor('adapter:index', 'Unit | Adapter | index', {
// Specify the other units that are required for this test.
// needs: ['serializer:foo']
});

// Replace this with your real tests.
test('it exists', function(assert) {
var adapter = this.subject();
assert.ok(adapter);
});