Fix maintenance period warning

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-07-30 12:58:35 +07:00
parent d86a6f5bcd
commit e7b31803a0
No known key found for this signature in database
GPG Key ID: BD80F68D68D8F7F2

View File

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import core, { RateLimiter } from '@hcengineering/core' import core, { RateLimiter, concatLink } from '@hcengineering/core'
import login from '@hcengineering/login' import login from '@hcengineering/login'
import { getEmbeddedLabel, getMetadata } from '@hcengineering/platform' import { getEmbeddedLabel, getMetadata } from '@hcengineering/platform'
import presentation, { getClient, isAdminUser } from '@hcengineering/presentation' import presentation, { getClient, isAdminUser } from '@hcengineering/presentation'
@ -109,9 +109,12 @@
on:click={() => { on:click={() => {
const endpoint = getMetadata(login.metadata.AccountsUrl) ?? '' const endpoint = getMetadata(login.metadata.AccountsUrl) ?? ''
if (endpoint !== '') { if (endpoint !== '') {
void fetch(endpoint + `/api/v1/manage?token=${token}&operation=maintenance&timeout=${warningTimeout}`, { void fetch(
method: 'PUT' concatLink(endpoint, `/api/v1/manage?token=${token}&operation=maintenance&timeout=${warningTimeout}`),
}) {
method: 'PUT'
}
)
} }
}} }}
/> />
@ -126,7 +129,7 @@
on:click={() => { on:click={() => {
const endpoint = getMetadata(login.metadata.AccountsUrl) ?? '' const endpoint = getMetadata(login.metadata.AccountsUrl) ?? ''
if (endpoint !== '') { if (endpoint !== '') {
void fetch(endpoint + `/api/v1/manage?token=${token}&operation=maintenance&timeout=-1`, { void fetch(concatLink(endpoint, `/api/v1/manage?token=${token}&operation=maintenance&timeout=-1`), {
method: 'PUT' method: 'PUT'
}) })
} }