mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-28 10:49:45 +02:00
fix front service upload
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
{
|
||||
"name": "@hcengineering/storage-client",
|
||||
"entries": [
|
||||
{
|
||||
"version": "0.7.6",
|
||||
"tag": "@hcengineering/storage-client_v0.7.6",
|
||||
"date": "Tue, 14 Oct 2025 15:36:13 GMT",
|
||||
"comments": {
|
||||
"patch": [
|
||||
{
|
||||
"comment": "fix front service upload"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "0.7.5",
|
||||
"tag": "@hcengineering/storage-client_v0.7.5",
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
# Change Log - @hcengineering/storage-client
|
||||
|
||||
This log was last generated on Tue, 14 Oct 2025 06:29:02 GMT and should not be manually modified.
|
||||
This log was last generated on Tue, 14 Oct 2025 15:36:13 GMT and should not be manually modified.
|
||||
|
||||
## 0.7.6
|
||||
Tue, 14 Oct 2025 15:36:13 GMT
|
||||
|
||||
### Patches
|
||||
|
||||
- fix front service upload
|
||||
|
||||
## 0.7.5
|
||||
Tue, 14 Oct 2025 06:29:02 GMT
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hcengineering/storage-client",
|
||||
"version": "0.7.5",
|
||||
"version": "0.7.6",
|
||||
"main": "lib/index.js",
|
||||
"svelte": "src/index.ts",
|
||||
"types": "types/index.d.ts",
|
||||
|
||||
@@ -175,8 +175,10 @@ describe('FrontStorage', () => {
|
||||
// Check FormData contents
|
||||
const uploadCall = mockUploadXhr.mock.calls[0]
|
||||
const formData = uploadCall[0].body as FormData
|
||||
expect(formData.get('file')).toBe(file)
|
||||
expect(formData.get('uuid')).toBe(uuid)
|
||||
const uploadedFile = formData.get('file') as File
|
||||
expect(uploadedFile).toBeInstanceOf(File)
|
||||
expect(uploadedFile.name).toBe(uuid)
|
||||
expect(uploadedFile.type).toBe('text/plain')
|
||||
})
|
||||
|
||||
it('should upload file with progress tracking', async () => {
|
||||
@@ -254,8 +256,10 @@ describe('FrontStorage', () => {
|
||||
)
|
||||
|
||||
const formData = (mockUploadXhr.mock.calls[0][0] as any).body as FormData
|
||||
expect(formData.get('file')).toBe(file)
|
||||
expect(formData.get('uuid')).toBe(uuid)
|
||||
const uploadedFile = formData.get('file') as File
|
||||
expect(uploadedFile).toBeInstanceOf(File)
|
||||
expect(uploadedFile.name).toBe(uuid)
|
||||
expect(uploadedFile.type).toBe('image/png')
|
||||
})
|
||||
|
||||
it('should handle empty files', async () => {
|
||||
@@ -270,8 +274,10 @@ describe('FrontStorage', () => {
|
||||
|
||||
expect(mockUploadXhr).toHaveBeenCalled()
|
||||
const formData = (mockUploadXhr.mock.calls[0][0] as any).body as FormData
|
||||
expect(formData.get('file')).toBe(file)
|
||||
expect(formData.get('uuid')).toBe(uuid)
|
||||
const uploadedFile = formData.get('file') as File
|
||||
expect(uploadedFile).toBeInstanceOf(File)
|
||||
expect(uploadedFile.name).toBe(uuid)
|
||||
expect(uploadedFile.type).toBe('text/plain')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -53,8 +53,7 @@ export class FrontStorage implements FileStorage {
|
||||
options?: FileStorageUploadOptions
|
||||
): Promise<void> {
|
||||
const formData = new FormData()
|
||||
formData.append('file', file)
|
||||
formData.append('uuid', uuid)
|
||||
formData.append('file', file, uuid)
|
||||
|
||||
await uploadXhr(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user