remult 3.2.2-next.2 → 3.2.3
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/esm/server/get-remult-admin-html.js +125 -111
- package/esm/server/remult-admin.js +2 -0
- package/esm/src/remult3/RepositoryImplementation.js +9 -0
- package/esm/src/server-action.js +2 -2
- package/package.json +1 -1
- package/server/get-remult-admin-html.js +1 -1
- package/server/remult-admin.d.ts +2 -0
- package/server/remult-admin.js +2 -1
- package/src/remult3/RepositoryImplementation.d.ts +2 -1
- package/src/remult3/RepositoryImplementation.js +18 -0
- package/src/server-action.js +2 -2
|
@@ -51,6 +51,7 @@ export function buildEntityInfo(options) {
|
|
|
51
51
|
if (relRepo.metadata.apiReadAllowed) {
|
|
52
52
|
relation = {
|
|
53
53
|
...relInfo,
|
|
54
|
+
allowNull: x.allowNull,
|
|
54
55
|
where,
|
|
55
56
|
entityKey: relRepo.metadata.key,
|
|
56
57
|
idField,
|
|
@@ -81,6 +82,7 @@ export function buildEntityInfo(options) {
|
|
|
81
82
|
caption: x.label,
|
|
82
83
|
relationToOne: relation,
|
|
83
84
|
inputType: x.inputType,
|
|
85
|
+
allowNull: x.allowNull,
|
|
84
86
|
type: x.inputType === InputTypes.json
|
|
85
87
|
? 'json'
|
|
86
88
|
: x.valueType === Number
|
|
@@ -1372,6 +1372,15 @@ export class rowHelperImplementation extends rowHelperBase {
|
|
|
1372
1372
|
repo;
|
|
1373
1373
|
edp;
|
|
1374
1374
|
_isNew;
|
|
1375
|
+
async _updateResultsFromServerAction(rowInfo) {
|
|
1376
|
+
await this._updateEntityBasedOnApi(rowInfo.data, true);
|
|
1377
|
+
if (this._isNew != rowInfo.isNewRow) {
|
|
1378
|
+
this._isNew = rowInfo.isNewRow;
|
|
1379
|
+
this.originalId = rowInfo.id;
|
|
1380
|
+
}
|
|
1381
|
+
if (!rowInfo.wasChanged)
|
|
1382
|
+
this.originalValues = this.copyDataToObject();
|
|
1383
|
+
}
|
|
1375
1384
|
constructor(info, instance, repo, edp, remult, _isNew, excludeRelationMembers) {
|
|
1376
1385
|
super(info.fieldsMetadata, instance, remult, _isNew, excludeRelationMembers);
|
|
1377
1386
|
this.info = info;
|
package/esm/src/server-action.js
CHANGED
|
@@ -193,7 +193,7 @@ export function BackendMethod(options) {
|
|
|
193
193
|
reg(controllerOptions.key +
|
|
194
194
|
'/' +
|
|
195
195
|
(options?.apiPrefix ? options.apiPrefix + '/' : '') +
|
|
196
|
-
key, options ? options.queue ?? false : false, options.allowed, async (d, req, res) => {
|
|
196
|
+
key, options ? (options.queue ?? false) : false, options.allowed, async (d, req, res) => {
|
|
197
197
|
d.args = d.args.map((x) => (isCustomUndefined(x) ? undefined : x));
|
|
198
198
|
let allowed = options.allowed;
|
|
199
199
|
try {
|
|
@@ -295,7 +295,7 @@ export function BackendMethod(options) {
|
|
|
295
295
|
id: defs.getOriginalId(),
|
|
296
296
|
},
|
|
297
297
|
}, baseUrl, http);
|
|
298
|
-
await defs.
|
|
298
|
+
await defs._updateResultsFromServerAction(r.rowInfo);
|
|
299
299
|
return r.result;
|
|
300
300
|
}
|
|
301
301
|
catch (err) {
|