Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.
This repository was 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

@conorroche

Description

@conorroche

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();
});
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions