mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 03:22:19 +03:00
pass space
for upload
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
d0c53e9437
commit
4e4b5ba5ab
@ -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
|
||||
|
@ -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<Doc>, file: File): Promise<string> {
|
||||
export async function uploadFile(id: Ref<Doc>, space: Ref<Space>, file: File): Promise<string> {
|
||||
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: {
|
||||
|
Loading…
Reference in New Issue
Block a user