Skip to content
Browse files

Merge pull request #3 from benadida/master

allow null projectId in task creation
  • Loading branch information...
2 parents d37fee1 + 3db3b19 commit fd6504c578c0c1b7fb3268b0ac641e4ebae55157 @indexzero committed Nov 29, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/asana-api/tasks.js
View
7 lib/asana-api/tasks.js
@@ -19,6 +19,9 @@ Tasks.prototype.get = function (task, callback) {
// name, notes, due_on, assignee, assignee_status
// as per
// http://developer.asana.com/documentation/#tasks
+//
+// projectId may be null, a single projectId, or an array of projectIds.
+//
Tasks.prototype.create = function(workspaceId, projectId, taskData, callback) {
taskData.workspace = workspaceId;
@@ -35,6 +38,10 @@ Tasks.prototype.create = function(workspaceId, projectId, taskData, callback) {
var task = result;
+ // no project to add it to? that is a bit weird but ok
+ if (!projectId)
+ return callback(null, task);
+
self.client.request({
method: "POST",
path: "/tasks/" + result.id + "/addProject",

0 comments on commit fd6504c

Please sign in to comment.
Something went wrong with that request. Please try again.