Skip to content

Commit

Permalink
beforeCreate now returns the data object, to match the beforeUpdate s…
Browse files Browse the repository at this point in the history
…ignature
  • Loading branch information
ivern committed Sep 14, 2015
1 parent 1f6caf7 commit e00eae7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core/api/api-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
}

if(this.beforeCreate) {
this.beforeCreate(data);
data = this.beforeCreate(data);
}

config = this._config(config);
Expand Down
2 changes: 2 additions & 0 deletions lib/core/api/tests/api-factory-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ describe('AvApiResource', function() {
'lastName': 'McGuinness'
};

users.beforeCreate = beforeCreateCallback.and.returnValue(data);

users.create(data);
$httpBackend.flush();

Expand Down

0 comments on commit e00eae7

Please sign in to comment.