From 70b6dd5c32fdc8f0e1592cf3406f572d559f38b1 Mon Sep 17 00:00:00 2001 From: Dirk Grappendorf Date: Tue, 29 Sep 2015 01:25:57 +0200 Subject: [PATCH] fix: 'new' is not passed as the action to _sendRequest() in new() --- grapp-rest-resource.html | 2 +- src/grapp-rest-resource.coffee | 2 +- test/basic.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/grapp-rest-resource.html b/grapp-rest-resource.html index 1afea68..7aca6d6 100644 --- a/grapp-rest-resource.html +++ b/grapp-rest-resource.html @@ -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); diff --git a/src/grapp-rest-resource.coffee b/src/grapp-rest-resource.coffee index 235863f..f574c55 100644 --- a/src/grapp-rest-resource.coffee +++ b/src/grapp-rest-resource.coffee @@ -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 diff --git a/test/basic.html b/test/basic.html index aaddbd3..39eb3f6 100644 --- a/test/basic.html +++ b/test/basic.html @@ -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"']