Skip to content

Commit

Permalink
[email protected] breaks build 🚨 (#30)
Browse files Browse the repository at this point in the history
* chore(package): update feathers-service-tests to version 0.6.1

* Use lodash.omit which creates a new object for data
  • Loading branch information
greenkeeperio-bot authored and daffl committed Jul 8, 2016
1 parent 912cb0e commit 2a54780
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
"npm": ">=1.4.0"
},
"dependencies": {
"babel-polyfill": "^6.7.4",
"feathers-errors": "^2.0.1",
"feathers-query-filters": "^1.5.1",
"lodash.omit": "^4.3.0",
"uberproto": "^1.2.0"
},
"devDependencies": {
Expand All @@ -60,7 +60,7 @@
"chai": "^3.0.0",
"feathers": "^2.0.0-pre.4",
"feathers-rest": "^1.3.0",
"feathers-service-tests": "^0.6.0",
"feathers-service-tests": "^0.6.1",
"feathers-socketio": "^1.3.3",
"jshint": "^2.8.0",
"mocha": "^2.5.0",
Expand Down
20 changes: 6 additions & 14 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
if(!global._babelPolyfill) { require('babel-polyfill'); }

import omit from 'lodash.omit';
import Proto from 'uberproto';
import filter from 'feathers-query-filters';
import errors from 'feathers-errors';
Expand Down Expand Up @@ -110,13 +109,10 @@ class Service {
patch(id, data, params) {
let { query, options } = multiOptions(id, this.id, params);

// We can not update the id
delete data[this.id];
delete data._id;

// Run the query
return nfcall(this.Model, 'update', query, { $set: data }, options)
.then(() => this._findOrGet(id, params));
return nfcall(this.Model, 'update', query, {
$set: omit(data, this.id, '_id')
}, options).then(() => this._findOrGet(id, params));
}

update(id, data, params) {
Expand All @@ -125,12 +121,8 @@ class Service {
}

let { query, options } = multiOptions(id, this.id, params);

// We can not update the id
data[this.id] = id;
delete data._id;

return nfcall(this.Model, 'update', query, data, options)

return nfcall(this.Model, 'update', query, omit(data, this.id, '_id'), options)
.then(() => this._findOrGet(id));
}

Expand Down

0 comments on commit 2a54780

Please sign in to comment.