These forums are your way of communicating with the community of people developing and using tools provided by the OneAll platform. The forums are run by the community and moderated by the OneAll team during office hours.
Please stick to technical issues - and remember, no confidential information - these are public forums!

BUG: Node-SDK shorturl.js

function create (url, callback) {
var body = {
shorturl: {
original_url: url
}
};
this.api.post('shorturls', null, body, function (error, result) {
this.api.retrieveData(error, result, 'shorturls', callback);
});
}

You forgot to bind(this).

function create (url, callback) {
var body = {
shorturl: {
original_url: url
}
};
this.api.post('shorturls', null, body, function (error, result) {
this.api.retrieveData(error, result, 'shorturls', callback);
}.bind(this));
}

Please also see my PR, it is pending:
https://github.com/oneall/node-js-sdk/pull/4
    Sign In or Register to comment.