@feardread/fear 1.0.9 → 1.1.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.
@@ -101,20 +101,14 @@ exports.read = tryCatch(async (Model, req, res) => {
101
101
  */
102
102
  exports.create = tryCatch(async (Model, req, res) => {
103
103
  const documentData = { ...req.body };
104
- console.log('raw document data = ', documentData);
105
104
  // Handle image uploads if present
106
105
  if (documentData.images) {
107
- // Parse comma-separated string to array if needed
108
- const imageArray = typeof documentData.images === 'string'
109
- ? documentData.images.split(',').map(item => item.trim())
110
- : documentData.images;
111
-
112
- await cloud.uploadImages(imageArray)
113
- .then((imageLinks) => {
114
- if (imageLinks) documentData.images = imageLinks;
115
- console.log('Uploaded Images:', imageLinks);
116
- })
117
- .catch((error) => { console.log('Error Uploading Images:: ', error);});
106
+
107
+ documentData.images.split(',').map(item => item.trim());
108
+
109
+ const imageLinks = await cloud.uploadImages(documentData.images);
110
+
111
+ if ( imageLinks ) documentData.images = imageLinks;
118
112
  }
119
113
 
120
114
  console.log('Creating document:', documentData);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feardread/fear",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {