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