mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 03:40:48 +00:00
Fix more links (#2577)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
2a2705f6fe
commit
dd7ee1c362
@ -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,
|
||||
|
@ -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: {
|
||||
|
@ -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
|
||||
|
@ -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) ?? ''),
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user