Allow task creation with parent.

The parent (shot_id in this case) is passed to the task creation end-point.
Also, the task type is now passed as form parameter, rather than on the
URL.
This commit is contained in:
2016-09-22 10:34:51 +02:00
parent 00da55045a
commit 62b72bfbb1
2 changed files with 14 additions and 8 deletions

View File

@@ -32,13 +32,14 @@ function task_create(shot_id, project_url, task_type) {
if (console) console.log("task_create(", shot_id, project_url, task_type, ") called.");
return;
}
var base_url = '/attract/' + project_url + '/tasks/create';
var url = '/attract/' + project_url + '/tasks/create';
if (task_type) {
base_url += '/' + task_type;
}
data = {
task_type: task_type,
parent: shot_id,
};
$.post(base_url, function(task_data) {
$.post(url, data, function(task_data) {
task_open(task_data.task_id, project_url);
})
.fail(function(xhr) {