1 | |
2 | * decline invite to workspace |
3 | * |
4 | */ |
5 | export async function main(body: { |
6 | workspace_id: string; |
7 | [k: string]: unknown; |
8 | }) { |
9 | const url = new URL(`${BASE_URL}/api/users/decline_invite`); |
10 |
|
11 | const response = await fetch(url, { |
12 | method: "POST", |
13 | headers: { |
14 | "Content-Type": "application/json", |
15 | Authorization: "Bearer " + WM_TOKEN, |
16 | }, |
17 | body: JSON.stringify(body), |
18 | }); |
19 | if (!response.ok) { |
20 | const text = await response.text(); |
21 | throw new Error(`${response.status} ${text}`); |
22 | } |
23 | return await response.text(); |
24 | } |
25 |
|