framework-do-dede 1.0.33 → 1.0.35
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/domain/Entity.js +5 -0
- package/package.json +1 -1
package/dist/domain/Entity.js
CHANGED
|
@@ -55,11 +55,16 @@ export class Entity {
|
|
|
55
55
|
const ctor = this.constructor;
|
|
56
56
|
const dbColumnConfigs = ctor._dbColumnConfigs || new Map();
|
|
57
57
|
const dbRecord = {};
|
|
58
|
+
for (const [key, value] of Object.entries(this)) {
|
|
59
|
+
dbRecord[key] = value;
|
|
60
|
+
}
|
|
58
61
|
for (const [propertyKey, configs] of dbColumnConfigs) {
|
|
59
62
|
const rawValue = this[propertyKey];
|
|
60
63
|
for (const config of configs) {
|
|
61
64
|
try {
|
|
62
65
|
let serializedValue = config.serialize ? await config.serialize(rawValue) : rawValue;
|
|
66
|
+
if (!serializedValue)
|
|
67
|
+
continue;
|
|
63
68
|
if (config.column) {
|
|
64
69
|
if (typeof config.column === "string") {
|
|
65
70
|
dbRecord[config.column] = serializedValue;
|