//native
/**
* Remove Project from Task
* Remove a task from a project. The task itself is kept.
*/
export async function main(auth: RT.Asana, task_gid: string, project: string) {
const response = await fetch(
`https://app.asana.com/api/1.0/tasks/${task_gid}/removeProject`,
{
method: "POST",
headers: {
Authorization: `Bearer ${auth.token}`,
"Content-Type": "application/json",
Accept: "application/json",
},
body: JSON.stringify({ data: { project } }),
}
)
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 3 hours ago