@zenstackhq/orm 3.3.0-beta.4 → 3.3.0
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.cjs +8 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -3150,11 +3150,15 @@ var BaseOperationHandler = class {
|
|
|
3150
3150
|
const autoUpdatedFields = [];
|
|
3151
3151
|
for (const [fieldName, fieldDef] of Object.entries(modelDef.fields)) {
|
|
3152
3152
|
if (fieldDef.updatedAt && finalData[fieldName] === void 0) {
|
|
3153
|
-
|
|
3154
|
-
|
|
3153
|
+
const ignoredFields = new Set(typeof fieldDef.updatedAt === "boolean" ? [] : fieldDef.updatedAt.ignore);
|
|
3154
|
+
const hasNonIgnoredFields = Object.keys(data).some((field) => (isScalarField(this.schema, modelDef.name, field) || isForeignKeyField(this.schema, modelDef.name, field)) && !ignoredFields.has(field));
|
|
3155
|
+
if (hasNonIgnoredFields) {
|
|
3156
|
+
if (finalData === data) {
|
|
3157
|
+
finalData = (0, import_common_helpers7.clone)(data);
|
|
3158
|
+
}
|
|
3159
|
+
finalData[fieldName] = this.dialect.transformInput(/* @__PURE__ */ new Date(), "DateTime", false);
|
|
3160
|
+
autoUpdatedFields.push(fieldName);
|
|
3155
3161
|
}
|
|
3156
|
-
finalData[fieldName] = this.dialect.transformInput(/* @__PURE__ */ new Date(), "DateTime", false);
|
|
3157
|
-
autoUpdatedFields.push(fieldName);
|
|
3158
3162
|
}
|
|
3159
3163
|
}
|
|
3160
3164
|
const thisEntity = await this.getEntityIds(kysely, model, combinedWhere);
|