Skip to content

Commit 13b6b15

Browse files
Merge pull request #29 from holidayextras/calling-back
Returning the correct callback in populate()
2 parents 6e70986 + c0268e6 commit 13b6b15

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
- 2016-06-07 - v1.2.1
2+
- 2016-06-07 - Fixing bug in populate()
13
- 2016-05-31 - v1.2.0
24
- 2016-05-31 - Use latest `jsonapi-server` processed filter
35
- 2016-05-13 - v1.1.0

lib/sqlHandler.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ SqlStore.prototype.populate = function(callback) {
8787
function(cb) {
8888
async.each(self.resourceConfig.examples, function(exampleJson, ecb) {
8989
var validation = Joi.validate(exampleJson, self.resourceConfig.attributes);
90-
if (validation.error) {
91-
return asyncCallback(validation.error);
92-
}
90+
if (validation.error) return ecb(validation.error);
9391
self.create({ request: { type: self.resourceConfig.resource } }, validation.value, ecb);
9492
}, cb);
9593
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jsonapi-store-relationaldb",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Relational data store for jsonapi-server.",
55
"keywords": [
66
"json:api",

0 commit comments

Comments
 (0)