remult 3.3.17 → 3.3.18

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.
@@ -267,8 +267,14 @@ export class ArrayEntityDataProvider {
267
267
  translateToJson(row, dbNames) {
268
268
  let result = {};
269
269
  for (const col of this.entity.fields) {
270
- if (!isDbReadonly(col, dbNames))
271
- result[dbNames.$dbNameOf(col)] = col.valueConverter.toJson(row[col.key]);
270
+ if (!isDbReadonly(col, dbNames)) {
271
+ let val = row[col.key];
272
+ if (val === undefined) {
273
+ if (col.allowNull)
274
+ val = null;
275
+ }
276
+ result[dbNames.$dbNameOf(col)] = col.valueConverter.toJson(val);
277
+ }
272
278
  }
273
279
  return result;
274
280
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remult",
3
- "version": "3.3.17",
3
+ "version": "3.3.18",
4
4
  "description": "A CRUD framework for full-stack TypeScript",
5
5
  "homepage": "https://remult.dev",
6
6
  "repository": {
@@ -441,8 +441,14 @@ var ArrayEntityDataProvider = /** @class */ (function () {
441
441
  try {
442
442
  for (var _b = tslib_1.__values(this.entity.fields), _c = _b.next(); !_c.done; _c = _b.next()) {
443
443
  var col = _c.value;
444
- if (!(0, filter_consumer_bridge_to_sql_request_js_1.isDbReadonly)(col, dbNames))
445
- result[dbNames.$dbNameOf(col)] = col.valueConverter.toJson(row[col.key]);
444
+ if (!(0, filter_consumer_bridge_to_sql_request_js_1.isDbReadonly)(col, dbNames)) {
445
+ var val = row[col.key];
446
+ if (val === undefined) {
447
+ if (col.allowNull)
448
+ val = null;
449
+ }
450
+ result[dbNames.$dbNameOf(col)] = col.valueConverter.toJson(val);
451
+ }
446
452
  }
447
453
  }
448
454
  catch (e_13_1) { e_13 = { error: e_13_1 }; }