Remove assignee from a task
1
//native
2
type Taskade = {
3
token: string
4
}
5
6
export async function main(
7
auth: Taskade,
8
projectId: string,
9
taskId: string,
10
assigneeHandle: string
11
) {
12
const url = new URL(
13
`https://www.taskade.com/api/v1/projects/${projectId}/tasks/${taskId}/assignees/${assigneeHandle}`
14
)
15
16
const response = await fetch(url, {
17
method: 'DELETE',
18
headers: {
19
Authorization: 'Bearer ' + auth.token
20
},
21
body: undefined
22
})
23
24
if (!response.ok) {
25
const text = await response.text()
26
throw new Error(`${response.status} ${text}`)
27
28
29
return await response.json()
30
31