@reldens/storage 0.82.0 → 0.83.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.
@@ -152,12 +152,12 @@ class PrismaDriver extends BaseDriver
152
152
  let isCreate = sc.get(options, 'isCreate', false);
153
153
  if(convertRelations){
154
154
  let converted = this.relationResolver.convertForeignKeysToRelations(params, isCreate);
155
- return this.castDataFields(converted, skipObjects);
155
+ return this.castDataFields(converted, skipObjects, isCreate);
156
156
  }
157
- return this.castDataFields(params, skipObjects);
157
+ return this.castDataFields(params, skipObjects, isCreate);
158
158
  }
159
159
 
160
- castDataFields(params, skipObjects = false)
160
+ castDataFields(params, skipObjects = false, isCreate = false)
161
161
  {
162
162
  let data = {};
163
163
  for(let key of Object.keys(params)){
@@ -165,6 +165,9 @@ class PrismaDriver extends BaseDriver
165
165
  if(skipObjects && sc.isObject(value) && !sc.isArray(value)){
166
166
  continue;
167
167
  }
168
+ if(isCreate && key === this.idFieldName && this.typeCaster.isNullOrEmpty(value)){
169
+ continue;
170
+ }
168
171
  let fieldType = this.fieldTypes[key];
169
172
  if(!fieldType){
170
173
  if(!skipObjects && !this.typeCaster.isNullOrEmpty(value)){
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@reldens/storage",
3
3
  "scope": "@reldens",
4
- "version": "0.82.0",
4
+ "version": "0.83.0",
5
5
  "description": "Reldens - Storage",
6
6
  "author": "Damian A. Pastorini",
7
7
  "license": "MIT",