mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-06 15:35:28 +00:00
25 lines
660 B
TypeScript
25 lines
660 B
TypeScript
import { ClientWorkspaceInfo } from '@hcengineering/account'
|
|
import config from './config'
|
|
|
|
/**
|
|
* @public
|
|
*/
|
|
export async function getWorkspaceInfo (token: string, updateLastModified = false): Promise<ClientWorkspaceInfo> {
|
|
const accountsUrl = config.AccountsURL
|
|
const workspaceInfo = await (
|
|
await fetch(accountsUrl, {
|
|
method: 'POST',
|
|
headers: {
|
|
Authorization: 'Bearer ' + token,
|
|
'Content-Type': 'application/json'
|
|
},
|
|
body: JSON.stringify({
|
|
method: 'getWorkspaceInfo',
|
|
params: updateLastModified ? [true] : []
|
|
})
|
|
})
|
|
).json()
|
|
|
|
return workspaceInfo.result as ClientWorkspaceInfo
|
|
}
|