@ruiapp/rapid-core 0.8.20 → 0.8.21
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/dist/index.js
CHANGED
|
@@ -2762,11 +2762,16 @@ async function validateEntity(server, model, entity) {
|
|
|
2762
2762
|
for (const propCode in entity) {
|
|
2763
2763
|
let prop = getEntityPropertyByCode(server, model, propCode);
|
|
2764
2764
|
if (!prop) {
|
|
2765
|
-
getEntityPropertyByFieldName(server, model, propCode);
|
|
2765
|
+
prop = getEntityPropertyByFieldName(server, model, propCode);
|
|
2766
2766
|
}
|
|
2767
2767
|
if (!prop) {
|
|
2768
2768
|
continue;
|
|
2769
2769
|
}
|
|
2770
|
+
if (propCode === "id") {
|
|
2771
|
+
if (lodash.isNil(entity[propCode])) {
|
|
2772
|
+
delete entity[propCode];
|
|
2773
|
+
}
|
|
2774
|
+
}
|
|
2770
2775
|
if (prop.type === "date") {
|
|
2771
2776
|
const originValue = entity[propCode];
|
|
2772
2777
|
if (originValue) {
|
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isNil } from "lodash";
|
|
1
2
|
import { IRpdServer } from "~/core/server";
|
|
2
3
|
import { getEntityPropertyByCode, getEntityPropertyByFieldName } from "~/helpers/metaHelper";
|
|
3
4
|
import { RpdDataModel } from "~/types";
|
|
@@ -7,13 +8,19 @@ export async function validateEntity(server: IRpdServer, model: RpdDataModel, en
|
|
|
7
8
|
for (const propCode in entity) {
|
|
8
9
|
let prop = getEntityPropertyByCode(server, model, propCode);
|
|
9
10
|
if (!prop) {
|
|
10
|
-
getEntityPropertyByFieldName(server, model, propCode);
|
|
11
|
+
prop = getEntityPropertyByFieldName(server, model, propCode);
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
if (!prop) {
|
|
14
15
|
continue;
|
|
15
16
|
}
|
|
16
17
|
|
|
18
|
+
if (propCode === "id") {
|
|
19
|
+
if (isNil(entity[propCode])) {
|
|
20
|
+
delete entity[propCode];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
17
24
|
if (prop.type === "date") {
|
|
18
25
|
const originValue = entity[propCode];
|
|
19
26
|
if (originValue) {
|