//native
type Clickup = {
token: string;
};
/**
* Update Group
* This endpoint is used to manage [User Groups](https://docs.
*/
export async function main(
auth: Clickup,
group_id: string,
body: {
name?: string;
handle?: string;
members?: { add: number[]; rem: number[] };
},
) {
const url = new URL(`https://api.clickup.com/api/v2/group/${group_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