diff --git a/plugins/recruit-resources/src/components/DialogHeader.svelte b/plugins/recruit-resources/src/components/DialogHeader.svelte index 426d23255b..b15bacd3e2 100644 --- a/plugins/recruit-resources/src/components/DialogHeader.svelte +++ b/plugins/recruit-resources/src/components/DialogHeader.svelte @@ -61,7 +61,7 @@ loading = true try { resumeId = generateId() - resumeUuid = await uploadFile(resumeId, file) + resumeUuid = await uploadFile(resumeId, space, file) resumeName = file.name resumeSize = file.size resumeType = file.type diff --git a/plugins/recruit-resources/src/utils.ts b/plugins/recruit-resources/src/utils.ts index fec3356b5e..57ec6ae326 100644 --- a/plugins/recruit-resources/src/utils.ts +++ b/plugins/recruit-resources/src/utils.ts @@ -14,19 +14,19 @@ // limitations under the License. // -import type { Ref, Doc } from '@anticrm/core' +import type { Ref, Doc, Space } from '@anticrm/core' import { getMetadata } from '@anticrm/platform' import login from '@anticrm/login' -export async function uploadFile(id: Ref, file: File): Promise { +export async function uploadFile(id: Ref, space: Ref, file: File): Promise { console.log(file) const uploadUrl = getMetadata(login.metadata.UploadUrl) const data = new FormData() data.append('file', file) - const url = `${uploadUrl}?id=${id}&space=space` + const url = `${uploadUrl}?id=${id}&space=${space}` const resp = await fetch(url, { method: 'POST', headers: {