mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-14 05:37:45 +02:00
23 lines
622 B
TypeScript
23 lines
622 B
TypeScript
import config from "../config.ts";
|
|
|
|
|
|
type WorkspaceInfo = {
|
|
workspaceId: string
|
|
}
|
|
|
|
export async function getWorkspaceInfo (token: string): Promise<WorkspaceInfo | undefined> {
|
|
const accountsUrl = config.AccountsUrl
|
|
const response = await fetch(accountsUrl, {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
Authorization: 'Bearer ' + token
|
|
},
|
|
body: JSON.stringify({
|
|
method: 'getWorkspaceInfo',
|
|
params: []
|
|
})
|
|
})
|
|
const result = await response.json()
|
|
return result.result as WorkspaceInfo | undefined
|
|
} |