Skip to content

Commit

Permalink
[email protected] breaks build 🚨 (#50)
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 to make sure the original data object does not get modified
  • Loading branch information
greenkeeperio-bot authored and daffl committed Jul 8, 2016
1 parent 7e1a370 commit 4c37438
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
"lib": "lib"
},
"dependencies": {
"babel-polyfill": "^6.3.14",
"feathers-errors": "^2.0.1",
"feathers-query-filters": "^1.5.1",
"lodash.omit": "^4.3.0",
"uberproto": "^1.1.2"
},
"devDependencies": {
Expand All @@ -62,9 +62,9 @@
"babel-preset-es2015": "^6.1.2",
"body-parser": "^1.14.1",
"chai": "^3.4.1",
"feathers": "^2.0.0-pre.4",
"feathers": "^2.0.0",
"feathers-rest": "^1.3.0",
"feathers-service-tests": "^0.6.0",
"feathers-service-tests": "^0.6.1",
"jshint": "^2.8.0",
"mocha": "^2.5.0",
"sequelize": "^3.14.1",
Expand Down
9 changes: 2 additions & 7 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 @@ -101,9 +100,7 @@ class Service {

const options = Object.assign({}, params.sequelize, { where });

delete data[this.id];

return this.Model.update(data, options)
return this.Model.update(omit(data, this.id), options)
.then(() => this._getOrFind(id, params))
.catch(utils.errorHandler);
}
Expand All @@ -115,8 +112,6 @@ class Service {
return Promise.reject('Not replacing multiple records. Did you mean `patch`?');
}

delete data[this.id];

return this.Model.findById(id).then(instance => {
if(!instance) {
throw new errors.NotFound(`No record found for id '${id}'`);
Expand Down

0 comments on commit 4c37438

Please sign in to comment.