feathers-sequelize
Advanced tools
Comparing version 1.4.0 to 1.4.1
# Change Log | ||
## [Unreleased](https://github.com/feathersjs/feathers-sequelize/tree/HEAD) | ||
## [v1.4.0](https://github.com/feathersjs/feathers-sequelize/tree/v1.4.0) (2016-11-11) | ||
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.3.3...v1.4.0) | ||
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.3.2...HEAD) | ||
**Closed issues:** | ||
- TypeError: Cannot read property '2' of null [\#71](https://github.com/feathersjs/feathers-sequelize/issues/71) | ||
- ES6/Babel [\#68](https://github.com/feathersjs/feathers-sequelize/issues/68) | ||
**Merged pull requests:** | ||
- Update feathers-service-tests to version 0.9.0 🚀 [\#79](https://github.com/feathersjs/feathers-sequelize/pull/79) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) | ||
- sequelize@3.25.0 breaks build 🚨 [\#78](https://github.com/feathersjs/feathers-sequelize/pull/78) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) | ||
- sequelize@3.24.8 breaks build 🚨 [\#77](https://github.com/feathersjs/feathers-sequelize/pull/77) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) | ||
- 👻😱 Node.js 0.10 is unmaintained 😱👻 [\#76](https://github.com/feathersjs/feathers-sequelize/pull/76) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) | ||
- babel-preset-es2015@6.18.0 breaks build 🚨 [\#75](https://github.com/feathersjs/feathers-sequelize/pull/75) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) | ||
- jshint —\> semistandard [\#72](https://github.com/feathersjs/feathers-sequelize/pull/72) ([corymsmith](https://github.com/corymsmith)) | ||
## [v1.3.3](https://github.com/feathersjs/feathers-sequelize/tree/v1.3.3) (2016-09-28) | ||
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.3.2...v1.3.3) | ||
**Merged pull requests:** | ||
- Update service tests, id and events option [\#65](https://github.com/feathersjs/feathers-sequelize/pull/65) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) | ||
@@ -10,0 +26,0 @@ |
@@ -117,9 +117,29 @@ 'use strict'; | ||
value: function _get(id, params) { | ||
return this.Model.findById(id, params.sequelize).then(function (instance) { | ||
if (!instance) { | ||
throw new _feathersErrors2.default.NotFound('No record found for id \'' + id + '\''); | ||
} | ||
var promise = void 0; | ||
return instance; | ||
}).then((0, _feathersCommons.select)(params, this.id)).catch(utils.errorHandler); | ||
if (params.sequelize && params.sequelize.include) { | ||
// If eager-loading is used, we need to use the find method | ||
var where = utils.getWhere(params.query); | ||
// Attach where constraints, if any where used. | ||
var q = _extends(_extends({ id: id }, where), params.sequelize); | ||
promise = this.Model.findAll(q).then(function (result) { | ||
if (result.length === 0) { | ||
throw new _feathersErrors2.default.NotFound('No record found for id \'' + id + '\''); | ||
} | ||
return result[0]; | ||
}); | ||
} else { | ||
promise = this.Model.findById(id, params.sequelize).then(function (instance) { | ||
if (!instance) { | ||
throw new _feathersErrors2.default.NotFound('No record found for id \'' + id + '\''); | ||
} | ||
return instance; | ||
}); | ||
} | ||
return promise.then((0, _feathersCommons.select)(params, this.id)).catch(utils.errorHandler); | ||
} | ||
@@ -242,4 +262,4 @@ | ||
function init(Model) { | ||
return new Service(Model); | ||
function init(options) { | ||
return new Service(options); | ||
} | ||
@@ -246,0 +266,0 @@ |
{ | ||
"name": "feathers-sequelize", | ||
"description": "A service adapter for Sequelize an SQL ORM", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"homepage": "https://github.com/feathersjs/feathers-sequelize", | ||
@@ -6,0 +6,0 @@ "main": "lib/", |
@@ -69,3 +69,3 @@ # feathers-sequelize | ||
// Create an in-memory Feathers service with a default page size of 2 items | ||
// Create an sqlite backed Feathers service with a default page size of 2 items | ||
// and a maximum size of 4 | ||
@@ -72,0 +72,0 @@ app.use('/todos', service({ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46523
316