Skip to content

Commit

Permalink
Cleanup scoped variables.
Browse files Browse the repository at this point in the history
Signed-off-by: François de Metz <francois@2metz.fr>
  • Loading branch information
francois2metz committed Mar 22, 2011
1 parent 121d6cc commit 148d943
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions intervals.js
Expand Up @@ -72,12 +72,14 @@ function chooseIn(list, propertyName, callback) {
* callback
*/
exports.addTime = function(options, client, callback) {
var clientId = null;
var time = {
time: options.time,
date: options.date,
billable : options.billable ? 't': 'f',
description: options.description
description: options.description,
projectid: null,
moduleid: null,
worktypeid: null
};
var sequence = futures.sequence();
sequence.then(function(next) {
Expand All @@ -94,11 +96,11 @@ exports.addTime = function(options, client, callback) {
function(err, res) {
console.log('Choose client:');
chooseIn(res.body.client, 'name', function(index) {
clientId = res.body.client[index].id;
next();
var clientId = res.body.client[index].id;
next(clientId);
});
});
}).then(function(next) {
}).then(function(next, clientId) {
client.project({active: 't',
clientid: clientId},
function(err, res) {
Expand Down

0 comments on commit 148d943

Please sign in to comment.