next-tinacms-cloudinary 6.0.0 → 7.0.0

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.
Files changed (2) hide show
  1. package/dist/handlers.js +11 -6
  2. package/package.json +4 -4
package/dist/handlers.js CHANGED
@@ -73,12 +73,17 @@ async function uploadMedia(req, res) {
73
73
  );
74
74
  await upload(req, res);
75
75
  const { directory } = req.body;
76
- const result = await import_cloudinary.v2.uploader.upload(req.file.path, {
77
- folder: directory.replace(/^\//, ""),
78
- use_filename: true,
79
- overwrite: false
80
- });
81
- res.json(result);
76
+ try {
77
+ const result = await import_cloudinary.v2.uploader.upload(req.file.path, {
78
+ folder: directory.replace(/^\//, ""),
79
+ use_filename: true,
80
+ overwrite: false,
81
+ resource_type: "auto"
82
+ });
83
+ res.json(result);
84
+ } catch (error) {
85
+ res.status(error.http_code).json({ message: error.message });
86
+ }
82
87
  }
83
88
  async function listMedia(req, res, opts) {
84
89
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-tinacms-cloudinary",
3
- "version": "6.0.0",
3
+ "version": "7.0.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "files": [
@@ -29,11 +29,11 @@
29
29
  "react": "^18.3.1",
30
30
  "react-dom": "^18.3.1",
31
31
  "typescript": "4.6.4",
32
- "tinacms": "2.0.0",
33
- "@tinacms/scripts": "1.1.6"
32
+ "@tinacms/scripts": "1.1.6",
33
+ "tinacms": "2.1.0"
34
34
  },
35
35
  "peerDependencies": {
36
- "tinacms": "2.0.0"
36
+ "tinacms": "2.1.0"
37
37
  },
38
38
  "publishConfig": {
39
39
  "registry": "https://registry.npmjs.org"