Skip to content

Commit

Permalink
Update feathers-query-filters to version 2.0.0 🚀 (#51)
Browse files Browse the repository at this point in the history
* chore(package): update feathers-query-filters to version 2.0.0

* Update feathers-query-filters usage
  • Loading branch information
greenkeeperio-bot authored and daffl committed Jul 10, 2016
1 parent 692f8a2 commit 7162406
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
"dependencies": {
"feathers-errors": "^2.0.1",
"feathers-query-filters": "^1.5.1",
"feathers-query-filters": "^2.0.0",
"lodash.omit": "^4.3.0",
"uberproto": "^1.1.2"
},
Expand Down
11 changes: 6 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,18 @@ class Service {
}

_find(params, getFilter = filter) {
let where = utils.getWhere(params.query);
let filters = getFilter(where);
let order = utils.getOrder(filters.$sort);
let query = Object.assign({
const { filters, query } = getFilter(params.query || {});
const where = utils.getWhere(query);
const order = utils.getOrder(filters.$sort);

const q = Object.assign({
where, order,
limit: filters.$limit,
offset: filters.$skip,
attributes: filters.$select || null
}, params.sequelize);

return this.Model.findAndCount(query).then(result => {
return this.Model.findAndCount(q).then(result => {
return {
total: result.count,
limit: filters.$limit,
Expand Down

0 comments on commit 7162406

Please sign in to comment.