fb-react-sdk
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -28,3 +28,3 @@ /** | ||
exports.version = '1.0.3'; | ||
exports.version = '1.0.4'; | ||
@@ -210,2 +210,24 @@ /** | ||
/** | ||
* https.del request wrapper | ||
*/ | ||
Graph.prototype.del = function() { | ||
var self = this; | ||
return superagent.del(this.options.uri) | ||
.send(this.postData) | ||
.end(function (err, res) { | ||
if (err) { | ||
return self.callback({ | ||
message: 'Error processing request' | ||
, exception: err | ||
}, null); | ||
} | ||
return self.end(res.body); | ||
}); | ||
}; | ||
/** | ||
* Accepts an url an returns facebook | ||
@@ -291,4 +313,3 @@ * json data to the callback provided | ||
* Deletes an object from the graph api | ||
* by sending a "DELETE", which is really | ||
* a post call, along with a method=delete param | ||
* by sending a "DELETE" request | ||
* | ||
@@ -301,7 +322,2 @@ * @param {string} url | ||
exports.del = function (url, postData, callback) { | ||
if (!url.match(/[?|&]method=delete/i)) { | ||
url += ~url.indexOf('?') ? '&' : '?'; | ||
url += 'method=delete'; | ||
} | ||
if (typeof postData === 'function') { | ||
@@ -312,3 +328,3 @@ callback = postData; | ||
return this.post(url, postData, callback); | ||
return new Graph('DEL', url, postData, callback); | ||
}; | ||
@@ -315,0 +331,0 @@ |
{ | ||
"name": "fb-react-sdk", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Facebook Graph API client", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -9,3 +9,3 @@ #### Note: fb-react-sdk is forked version from [FBgraph](http://criso.github.com/fbgraph/). The forked version is capable of working directly with your react application with no dependency on node.js. In other words, you can use this module in your React application that uses webpack or es6+. The rest of the documentation remains the same as FBgraph. | ||
### Version: 1.0.3 | ||
### Version: 1.0.4 | ||
@@ -12,0 +12,0 @@ ## Oh nooooooesss - MOAR facebook |
Sorry, the diff of this file is not supported yet
58872
811