diff options
Diffstat (limited to 'lib/caldav/request/asset.js')
-rw-r--r-- | lib/caldav/request/asset.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/caldav/request/asset.js b/lib/caldav/request/asset.js index b26e4f7..98c943a 100644 --- a/lib/caldav/request/asset.js +++ b/lib/caldav/request/asset.js @@ -71,6 +71,8 @@ * * @param {Object} [options] calendar options. * @param {Function} callback node style [err, data, xhr]. + * @return {Caldav.Xhr} The underlying xhr request so that the caller + * has a chance to abort the request. */ get: function(options, callback) { if (typeof(options) === 'function') { @@ -80,7 +82,7 @@ var req = this._buildRequest('GET', options); - req.send(function(err, xhr) { + return req.send(function(err, xhr) { callback(err, xhr.responseText, xhr); }); }, @@ -91,6 +93,8 @@ * @param {Object} [options] see get. * @param {String} data post content. * @param {Function} callback node style [err, data, xhr]. + * @return {Caldav.Xhr} The underlying xhr request so that the caller + * has a chance to abort the request. */ put: function(options, data, callback) { if (typeof(options) === 'string') { @@ -106,7 +110,7 @@ var req = this._buildRequest('PUT', options); req.data = data; - req.send(function(err, xhr) { + return req.send(function(err, xhr) { callback(err, xhr.responseText, xhr); }); }, @@ -116,6 +120,8 @@ * * @param {Object} [options] see get. * @param {Function} callback node style [err, data, xhr]. + * @return {Caldav.Xhr} The underlying xhr request so that the caller + * has a chance to abort the request. */ delete: function(options, callback) { if (typeof(options) === 'function') { @@ -125,7 +131,7 @@ var req = this._buildRequest('DELETE', options); - req.send(function(err, xhr) { + return req.send(function(err, xhr) { callback(err, xhr.responseText, xhr); }); } |