how to properly use javascript google task api?

458 views Asked by At

I try to update a task with the following code but its not working and I do not get any feedback from it:

gapi.client.tasks.tasks.update({'task': task.id, 'tasklist': taskList.id, 'body': {'status': 'completed'}});

I successfully retrieve both tasklists and tasks, but not updating them. I have the following permission scope:

https://www.googleapis.com/auth/tasks

My question is how do I use the javascript api to do updates? Are there any guides available online?

1

There are 1 answers

1
Rob On BEST ANSWER

I found a solution, you need to send the update as a second parameter to the update method:

gapi.client.tasks.tasks.update({'task': task.id, 'tasklist': taskList.id}, task).then(function (response) {});