Merge "Adding PUT to REST api service"

This commit is contained in:
Jenkins 2015-07-29 06:18:11 +00:00 committed by Gerrit Code Review
commit c3a6bb9bac
2 changed files with 12 additions and 0 deletions

View File

@ -57,6 +57,10 @@ limitations under the License.
return httpCall('PATCH', url, data, config);
};
this.put = function(url, data, config) {
return httpCall('PUT', url, data, config);
};
// NOTE the deviation from $http.delete which does not have the data param
this.delete = function (url, data, config) {
return httpCall('DELETE', url, data, config);

View File

@ -72,6 +72,14 @@
testBadCall(api.patch, 'PATCH');
});
it('should call success on a good PUT response', function () {
testGoodCall(api.put, 'PUT');
});
it('should call error on a bad PUT response', function () {
testBadCall(api.put, 'PUT');
});
it('should call success on a good DELETE response', function () {
testGoodCall(api.delete, 'DELETE');
});