Skip to content

Commit

Permalink
fix: 'new' is not passed as the action to _sendRequest() in new()
Browse files Browse the repository at this point in the history
  • Loading branch information
grappendorf committed Sep 28, 2015
1 parent 4972bc9 commit 70b6dd5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion grapp-rest-resource.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"new": (function(_this) {
return function() {
return new Promise(function(resolve, reject) {
return _this._sendRequest('GET', _this.newPath, _this.newQuery, null, 'new').then(function(request) {
return _this._sendRequest('GET', _this.newPath, _this.newQuery, null, null, 'new').then(function(request) {
return _this._handleResponse(request.response, request.xhr.status, resolve);
}, function() {
return _this._handleError(_this.request.xhr.response, _this.request.xhr.status, reject);
Expand Down
2 changes: 1 addition & 1 deletion src/grapp-rest-resource.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Polymer

new: () =>
new Promise (resolve, reject) =>
@_sendRequest('GET', @newPath, @newQuery, null, 'new').then (request) =>
@_sendRequest('GET', @newPath, @newQuery, null, null, 'new').then (request) =>
@_handleResponse request.response, request.xhr.status, resolve
, =>
@_handleError @request.xhr.response, @request.xhr.status, reject
Expand Down
2 changes: 1 addition & 1 deletion test/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
[200, {'Content-Type': 'application/json'}, '"request-with-special-index-path"']
@server.respondWith 'GET', '/special_show_path',
[200, {'Content-Type': 'application/json'}, '"request-with-special-show-path"']
@server.respondWith 'GET', '/special_new_path',
@server.respondWith 'GET', '/special_new_path/new',
[200, {'Content-Type': 'application/json'}, '"request-with-special-new-path"']
@server.respondWith 'POST', '/special_create_path',
[200, {'Content-Type': 'application/json'}, '"request-with-special-create-path"']
Expand Down

0 comments on commit 70b6dd5

Please sign in to comment.