@cocreate/url-uploader 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/index.js +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.0.1](https://github.com/CoCreate-app/CoCreate-url-uploader/compare/v1.0.0...v1.0.1) (2024-06-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* return error in data ([3e20409](https://github.com/CoCreate-app/CoCreate-url-uploader/commit/3e2040949f02643a50a0d5a116830d2655f6143f))
|
|
7
|
+
|
|
1
8
|
# 1.0.0 (2024-06-29)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -39,11 +39,13 @@ class CoCreateUrlUploader {
|
|
|
39
39
|
const response = await fetch(file.src);
|
|
40
40
|
|
|
41
41
|
if (!response.ok) {
|
|
42
|
-
|
|
42
|
+
data.error = 'Failed to fetch file: ' + response.statusText
|
|
43
|
+
if (data.socket)
|
|
44
|
+
return this.crud.wsManager.send(data)
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
const arrayBuffer = await response.arrayBuffer();
|
|
46
|
-
file.src = arrayBufferToBase64(arrayBuffer)
|
|
48
|
+
file.src = this.arrayBufferToBase64(arrayBuffer)
|
|
47
49
|
|
|
48
50
|
file.size = arrayBuffer.byteLength
|
|
49
51
|
file['content-type'] = response.headers.get('content-type')
|