@cocreate/crud-server 1.20.2 → 1.20.4

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.20.4](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.20.3...v1.20.4) (2023-05-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * apikey renamed to key ([7132442](https://github.com/CoCreate-app/CoCreate-crud-server/commit/71324420f4708f1c8ec03b64e6286deb34238cf8))
7
+
8
+ ## [1.20.3](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.20.2...v1.20.3) (2023-05-10)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * return resolve ([eafc5e5](https://github.com/CoCreate-app/CoCreate-crud-server/commit/eafc5e59c59e3a3835a85b6e46a164f11fc6a80b))
14
+
1
15
  ## [1.20.2](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.20.1...v1.20.2) (2023-05-07)
2
16
 
3
17
 
@@ -1,6 +1,6 @@
1
1
  module.exports = {
2
2
  "config": {
3
- "apiKey": "2061acef-0451-4545-f754-60cf8160",
3
+ "key": "2061acef-0451-4545-f754-60cf8160",
4
4
  "organization_id": "5ff747727005da1c272740ab",
5
5
  "host": "general.cocreate.app"
6
6
  },
package/docs/index.html CHANGED
@@ -89,7 +89,7 @@
89
89
  </div>
90
90
  <script>
91
91
  var CoCreateConfig = {
92
- apiKey: 'c2b08663-06e3-440c-ef6f-13978b42883a',
92
+ key: 'c2b08663-06e3-440c-ef6f-13978b42883a',
93
93
  organization_id: '5ff747727005da1c272740ab'
94
94
  }
95
95
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/crud-server",
3
- "version": "1.20.2",
3
+ "version": "1.20.4",
4
4
  "description": "CoCreate-crud-server",
5
5
  "keywords": [
6
6
  "cocreate-crud",
package/src/index.js CHANGED
@@ -98,11 +98,11 @@ class CoCreateCrudServer {
98
98
  return new Promise(async (resolve) => {
99
99
  try {
100
100
  if (!data.organization_id)
101
- resolve()
101
+ return resolve()
102
102
 
103
103
  let dbUrl = this.databaseUrls.get(data.organization_id)
104
- if (dbUrl === 'false' || dbUrl === false)
105
- resolve()
104
+ if (dbUrl === false)
105
+ return resolve({dbUrl: false, error: 'database url could not be found'})
106
106
 
107
107
  if (!dbUrl) {
108
108
  if (data.organization_id === process.env.organization_id) {
@@ -122,9 +122,11 @@ class CoCreateCrudServer {
122
122
  dbUrl = organization.databases
123
123
  this.databaseUrls.set(data.organization_id, dbUrl)
124
124
  } else {
125
- this.databaseUrls.set(data.organization_id, 'false')
126
- console.log('organization or dbUrl urls could not be found')
127
- resolve()
125
+ this.databaseUrls.set(data.organization_id, false)
126
+ if (organization)
127
+ return resolve({dbUrl: false, error: 'database url could not be found'})
128
+ else
129
+ return resolve({organization: false, error: 'organization could not be found'})
128
130
  }
129
131
  }
130
132
  }