@cocreate/crud-server 1.28.6 → 1.28.8

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 CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.28.8](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.28.7...v1.28.8) (2023-10-16)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * improved error handling ([aa57afd](https://github.com/CoCreate-app/CoCreate-crud-server/commit/aa57afd5e20b8512ec9db7948fda35948b9d109b))
7
+
8
+ ## [1.28.7](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.28.6...v1.28.7) (2023-10-14)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * bump dependencies ([7200c10](https://github.com/CoCreate-app/CoCreate-crud-server/commit/7200c1031bb59c2693cc54ce561ff9a44017be56))
14
+
1
15
  ## [1.28.6](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.28.5...v1.28.6) (2023-10-09)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/crud-server",
3
- "version": "1.28.6",
3
+ "version": "1.28.8",
4
4
  "description": "CoCreate-crud-server",
5
5
  "keywords": [
6
6
  "cocreate-crud",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "homepage": "https://cocreate.app/docs/CoCreate-crud-server",
42
42
  "dependencies": {
43
- "@cocreate/config": "^1.6.0",
43
+ "@cocreate/config": "^1.6.1",
44
44
  "@cocreate/utils": "^1.25.0",
45
45
  "csvtojson": "^2.0.10",
46
46
  "json-2-csv": "^3.10.3"
package/src/index.js CHANGED
@@ -78,7 +78,7 @@ class CoCreateCrudServer {
78
78
 
79
79
  let storages = this.storages.get(data.organization_id)
80
80
  if (storages === false)
81
- return resolve({ storage: false, error: 'A storage or database could not be found' })
81
+ return resolve({ serverStorage: false, error: 'A storage or database could not be found' })
82
82
 
83
83
  if (!storages) {
84
84
  if (data.organization_id === this.config.organization_id) {
@@ -93,17 +93,15 @@ class CoCreateCrudServer {
93
93
  object: [{ _id: data.organization_id }],
94
94
  organization_id: this.config.organization_id
95
95
  })
96
- if (organization && organization.object && organization.object[0])
97
- organization = organization.object[0]
98
- if (organization && organization.storage) {
99
- storages = organization.storage
100
- this.storages.set(data.organization_id, storages)
101
- } else {
102
- this.storages.set(data.organization_id, false)
103
- if (organization)
104
- return resolve({ storage: false, error: 'database url could not be found' })
96
+ if (organization
97
+ && organization.object
98
+ && organization.object[0]) {
99
+ if (organization.object[0].storage)
100
+ this.storages.set(data.organization_id, organization.object[0].storage)
105
101
  else
106
- return resolve({ organization: false, error: 'organization could not be found' })
102
+ return resolve({ serverStorage: false, error: 'A storage url could not be found' })
103
+ } else {
104
+ return resolve({ serverOrganization: false, error: 'An organization could not be found' })
107
105
  }
108
106
  }
109
107
  }