//native
type Clickup = {
token: string;
};
/**
* Update List
* Rename a List, update the List Info description, set a due date/time, set the List's priority, set an assignee, set or remove the List color.
*/
export async function main(
auth: Clickup,
list_id: string,
body: {
name: string;
content?: string;
markdown_content?: string;
due_date?: number;
due_date_time?: false | true;
priority?: number;
assignee?: string;
status?: string;
unset_status?: false | true;
},
) {
const url = new URL(`https://api.clickup.com/api/v2/list/${list_id}`);
const response = await fetch(url, {
method: "PUT",
headers: {
"Content-Type": "application/json",
Authorization: auth.token,
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 235 days ago