Fix more links (#2577)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2023-02-02 14:01:01 +06:00 committed by GitHub
parent 2a2705f6fe
commit dd7ee1c362
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 7 deletions

View File

@ -13,6 +13,7 @@
// limitations under the License.
//
import { concatLink } from '@hcengineering/core'
import { getMetadata, PlatformError, unknownError } from '@hcengineering/platform'
import plugin from './plugin'
import { ReconiDocument } from './types'
@ -30,7 +31,7 @@ export async function recognizeDocument (token: string, url: string, contentType
throw new PlatformError(unknownError('recognition framework is not configured'))
}
return (await (
await fetch(rekoniUrl + '/recognize', {
await fetch(concatLink(rekoniUrl, '/recognize'), {
method: 'POST',
headers: {
Authorization: 'Bearer ' + token,

View File

@ -15,7 +15,7 @@
//
import { Attachment } from '@hcengineering/attachment'
import type { Class, Data, Doc, Ref, Space, TxOperations as Client } from '@hcengineering/core'
import { Class, concatLink, Data, Doc, Ref, Space, TxOperations as Client } from '@hcengineering/core'
import login from '@hcengineering/login'
import { getMetadata, setPlatformStatus, unknownError } from '@hcengineering/platform'
@ -47,9 +47,9 @@ export async function uploadFile (file: File): Promise<string> {
}
export async function deleteFile (id: string): Promise<void> {
const uploadUrl = getMetadata(login.metadata.UploadUrl)
const uploadUrl = getMetadata(login.metadata.UploadUrl) ?? ''
const url = `${uploadUrl as string}?file=${id}`
const url = concatLink(uploadUrl, `?file=${id}`)
const resp = await fetch(url, {
method: 'DELETE',
headers: {

View File

@ -6,6 +6,7 @@ import core, {
ApplyOperations,
AttachedDoc,
Class,
concatLink,
Data,
Doc,
DocumentUpdate,
@ -149,7 +150,7 @@ export async function syncPlatform (
const data = new FormData()
data.append('file', ed)
const resp = await fetch(frontUrl + '/files', {
const resp = await fetch(concatLink(frontUrl, '/files'), {
method: 'POST',
headers: {
Authorization: 'Bearer ' + info.token

View File

@ -20,6 +20,7 @@ import Main from './components/Main.svelte'
import Connect from './components/Connect.svelte'
import IconGmail from './components/icons/GmailColor.svelte'
import TxSharedCreate from './components/activity/TxSharedCreate.svelte'
import { concatLink } from '@hcengineering/core'
export default async (): Promise<Resources> => ({
component: {
@ -33,7 +34,7 @@ export default async (): Promise<Resources> => ({
handler: {
DisconnectHandler: async () => {
const url = getMetadata(login.metadata.GmailUrl) ?? ''
await fetch(url + '/signout', {
await fetch(concatLink(url, '/signout'), {
method: 'GET',
headers: {
Authorization: 'Bearer ' + (getMetadata(login.metadata.LoginToken) ?? ''),

View File

@ -683,7 +683,7 @@ export async function requestPassword (db: Db, productId: string, email: string)
</p><p>If you have not ordered a password recovery just ignore this letter.</p>`
const subject = 'Password recovery'
const to = account.email
await fetch(`${sesURL}/send`, {
await fetch(concatLink(sesURL, '/send'), {
method: 'post',
headers: {
'Content-Type': 'application/json'