Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

callbacks for me, get, post, fbql are missing error params needed by faceplate 0.6 #17

Open
conorroche opened this issue Nov 9, 2013 · 0 comments

Comments

@conorroche
Copy link

I came across several issues getting this to work today:

faceplate index.js passes the error as the first param to the callback e.g.

this.me = function(cb) {
if (self.token) {
self.get('/me', function(err, me) {
console.log('get fb user: ' + JSON.stringify(me) + ', err: ' + err);
cb(err,me);
});
} else {
console.log('error get fb user no token');
cb(null,null);
}
};

but in web.js it has:

req.facebook.me(function(user) {

when should be

req.facebook.me(function(err, user) {

same issue applies to get and fql calls in handle_facebook_request

Also it looks like the data object that faceplate returns in the success callback for the get request stores the friends in a field called data so where faceplate calls the callback like this:

request.on('success', function(data) {
cb(null, data);
});

in web.js to get friends would be:

function(cb) {
// query 4 friends and send them to the socket for this socket id
req.facebook.get('/me/friends', { limit: 4 }, function(err, friends) {
req.friends = friends.data;
cb();
});
},

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant