@cocreate/crud-server
Advanced tools
Comparing version 1.24.3 to 1.24.4
@@ -0,1 +1,8 @@ | ||
## [1.24.4](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.24.3...v1.24.4) (2023-06-15) | ||
### Bug Fixes | ||
* check if this.config ([151ab0d](https://github.com/CoCreate-app/CoCreate-crud-server/commit/151ab0d8b912c1c7b0369f596f4ae22e19831587)) | ||
## [1.24.3](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.24.2...v1.24.3) (2023-06-15) | ||
@@ -2,0 +9,0 @@ |
{ | ||
"name": "@cocreate/crud-server", | ||
"version": "1.24.3", | ||
"version": "1.24.4", | ||
"description": "CoCreate-crud-server", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -18,5 +18,5 @@ 'use strict'; | ||
'organization_id': { prompt: 'Enter your organization_id: ' }, | ||
'name': { | ||
'storage': { | ||
prompt: 'Enter a friendly name for the new storage: ', | ||
variable: true | ||
variable: 'name' | ||
}, | ||
@@ -130,5 +130,21 @@ 'storage.{{name}}.provider': { | ||
try { | ||
if (!data.organization_id) | ||
if (!data.organization_id || !this.config) | ||
return resolve() | ||
if (!this.config) | ||
this.config = await Config({ | ||
'organization_id': { prompt: 'Enter your organization_id: ' }, | ||
'storage': { | ||
prompt: 'Enter a friendly name for the new storage: ', | ||
variable: 'name' | ||
}, | ||
'storage.{{name}}.provider': { | ||
prompt: 'Enter the storage provider, ex mongodb: ' | ||
}, | ||
'storage.{{name}}.url': { | ||
prompt: 'Enter the storage providers url: ' | ||
} | ||
}) | ||
let storage = this.storages.get(data.organization_id) | ||
@@ -139,6 +155,6 @@ if (storage === false) | ||
if (!storage) { | ||
if (data.organization_id === this.config.orgaization_id) { | ||
storage = pthis.config.storage | ||
if (data.organization_id === this.config.organization_id) { | ||
storage = this.config.storage | ||
if (storage) | ||
this.storages.set(data.organization_id, JSON.parse(storage)) | ||
this.storages.set(data.organization_id, storage) | ||
} else { | ||
@@ -145,0 +161,0 @@ let organization = await this.readDocument({ |
115493
412