remult 2.7.30 → 2.7.31

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.
@@ -93,9 +93,17 @@ export function buildEntityInfo(options) {
93
93
  }
94
94
  }
95
95
  if (metadata.apiReadAllowed) {
96
+ let superKey = metadata.key;
97
+ let caption = metadata.caption;
98
+ const nbOfEntities = entities.filter(e => e.key === metadata.key).length;
99
+ if (nbOfEntities > 0) {
100
+ superKey = metadata.key + '_ext_' + nbOfEntities;
101
+ caption = metadata.caption + '*'.repeat(nbOfEntities);
102
+ }
96
103
  entities.push({
104
+ superKey,
97
105
  key: metadata.key,
98
- caption: metadata.caption,
106
+ caption,
99
107
  ids,
100
108
  fields,
101
109
  relations,
@@ -136,7 +136,9 @@ export class ValueConverters {
136
136
  toJson: (value) => ValueConverters.Number.toDb(value),
137
137
  fromInput: (x, type) => {
138
138
  let r = +x;
139
- if (x === null || x === undefined)
139
+ if (x === null)
140
+ return null;
141
+ if (x === undefined)
140
142
  return undefined;
141
143
  return r;
142
144
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remult",
3
- "version": "2.7.30",
3
+ "version": "2.7.31",
4
4
  "description": "A CRUD framework for full-stack TypeScript",
5
5
  "homepage": "https://remult.dev",
6
6
  "repository": {