rads-db 3.1.4 → 3.1.5
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 +3 -1
- package/dist/index.mjs +3 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -352,7 +352,9 @@ const computedPresets = {
|
|
|
352
352
|
throw new Error('To use "createdBy" preset, please, provide "context.getUser" to "createRads" call.');
|
|
353
353
|
return ___default.pick(ctx.getUser(), "id");
|
|
354
354
|
},
|
|
355
|
-
updatedBy: ({ doc, ctx }) => {
|
|
355
|
+
updatedBy: ({ doc, oldDoc, fieldName, ctx }) => {
|
|
356
|
+
if (ctx.isVerifying && oldDoc?.updatedBy)
|
|
357
|
+
return oldDoc.updatedBy;
|
|
356
358
|
if (!ctx.getUser)
|
|
357
359
|
throw new Error('To use "updatedBy" preset, please, provide "context.getUser" to "createRads" call.');
|
|
358
360
|
return ___default.pick(ctx.getUser(), "id");
|
package/dist/index.mjs
CHANGED
|
@@ -345,7 +345,9 @@ const computedPresets = {
|
|
|
345
345
|
throw new Error('To use "createdBy" preset, please, provide "context.getUser" to "createRads" call.');
|
|
346
346
|
return _.pick(ctx.getUser(), "id");
|
|
347
347
|
},
|
|
348
|
-
updatedBy: ({ doc, ctx }) => {
|
|
348
|
+
updatedBy: ({ doc, oldDoc, fieldName, ctx }) => {
|
|
349
|
+
if (ctx.isVerifying && oldDoc?.updatedBy)
|
|
350
|
+
return oldDoc.updatedBy;
|
|
349
351
|
if (!ctx.getUser)
|
|
350
352
|
throw new Error('To use "updatedBy" preset, please, provide "context.getUser" to "createRads" call.');
|
|
351
353
|
return _.pick(ctx.getUser(), "id");
|