@strapi/provider-upload-cloudinary 0.0.0-e6cac9fe30 → 0.0.0-fd8e4c6bfa
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/lib/index.js +5 -3
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -14,7 +14,7 @@ module.exports = {
|
|
|
14
14
|
cloudinary.config(config);
|
|
15
15
|
|
|
16
16
|
const upload = (file, customConfig = {}) =>
|
|
17
|
-
new Promise((resolve) => {
|
|
17
|
+
new Promise((resolve, reject) => {
|
|
18
18
|
const config = {
|
|
19
19
|
resource_type: 'auto',
|
|
20
20
|
public_id: file.hash,
|
|
@@ -29,9 +29,11 @@ module.exports = {
|
|
|
29
29
|
(err, image) => {
|
|
30
30
|
if (err) {
|
|
31
31
|
if (err.message.includes('File size too large')) {
|
|
32
|
-
|
|
32
|
+
reject(new PayloadTooLargeError());
|
|
33
|
+
} else {
|
|
34
|
+
reject(new Error(`Error uploading to cloudinary: ${err.message}`));
|
|
33
35
|
}
|
|
34
|
-
|
|
36
|
+
return;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
if (image.resource_type === 'video') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/provider-upload-cloudinary",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-fd8e4c6bfa",
|
|
4
4
|
"description": "Cloudinary provider for strapi upload",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"upload",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"test": "echo \"no tests yet\""
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@strapi/utils": "0.0.0-
|
|
39
|
+
"@strapi/utils": "0.0.0-fd8e4c6bfa",
|
|
40
40
|
"cloudinary": "^1.30.1",
|
|
41
41
|
"into-stream": "^5.1.0"
|
|
42
42
|
},
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"node": ">=14.19.1 <=16.x.x",
|
|
45
45
|
"npm": ">=6.0.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "fd8e4c6bfa2fd687a3c62f8428e00f3b320c32c2"
|
|
48
48
|
}
|