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 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");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rads-db",
3
- "version": "3.1.4",
3
+ "version": "3.1.5",
4
4
  "packageManager": "pnpm@8.6.1",
5
5
  "description": "Say goodbye to boilerplate code and hello to efficient and elegant syntax.",
6
6
  "author": "",