//native
type Clickup = {
token: string;
};
/**
* Get List Views
* View the task and page views available for a List. Views and required views are separate responses.
*/
export async function main(auth: Clickup, list_id: string) {
const url = new URL(`https://api.clickup.com/api/v2/list/${list_id}/view`);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 235 days ago