Wrote my first node.js to access Google Tasks. I was able to successfully read the notes of a specific task I had set up into a text variable as follows:
function getTask(auth) {
const service = google.tasks({version: 'v1', auth});
service.tasks.list({
tasklist: "MTAxNTxxxxxxxxxxxxxxxxxxxxk6MDow",
}, (err, res) => {
if (err) return console.error('The API returned an error for LIST: ' + err);
const task = res.data.items;
const text = task.find(c => c.title == "ToDo").notes;
console.log(text);
});
} //end getTask()
Now I would like to modify the contents of "text" variable and write it back to Google api. I notice there's a function called setTask() in the api, but I'm not sure how to implement it for this purpose. All the reference material I've pored through didn't really seem to apply to my needs and I'm a real newb with api stuff so be gentle with me!