Merge "Adding PUT to REST api service"
This commit is contained in:
commit
c3a6bb9bac
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue