simplyspoke / node-harvest

Node.js Client API for the Harvest time tracking service
http://simplyspoke.github.io/node-harvest/
MIT License
106 stars 57 forks source link

GET /projects results in error #18

Closed marol87 closed 9 years ago

marol87 commented 9 years ago

I'm trying to get data from /projects using this router.get:

in app.js

router.get('/projects', function(req, res) {
    var harvest = new Harvest(req.session.user);
    harvest.Projects({}, function(err, data){ 
        projects = data.projects;
        res.send({ projects: projects });
    }); 
});

The "harvest.Projects" results in a "TypeError: Property 'Projects' of object [object Object] is not a function". I've tried many versions but I can't seem to find the correct one. I would really like to get som help with this because I can't see where the error is coming from. I have no problem getting data from "harvest.TimeTracking" for example.

paul-english commented 9 years ago

Projects is an object which has methods relating to get, post, delete, etc. Have a look at the example code in the tests, https://github.com/log0ymxm/node-harvest/blob/master/test/projects-api-tests.js#L32-L37