Skip to content

Commit 64e6ba5

Browse files
committed
Refactor metadata structure in history plugin to simplify createdBy and createdAt fields
1 parent cc1c703 commit 64e6ba5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/_common/plugins/mongoose/history.plugin.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ export function historyPlugin(schema: Schema, options: HistoryPluginOptions) {
135135
data: after,
136136
changes,
137137
metadata: {
138-
'metadata.createdBy': agent.name || 'anonymous',
139-
'metadata.createdAt': new Date(),
138+
createdBy: agent.name || 'anonymous',
139+
createdAt: new Date(),
140140
},
141141
})
142142
})
@@ -168,8 +168,8 @@ export function historyPlugin(schema: Schema, options: HistoryPluginOptions) {
168168
data: after,
169169
changes,
170170
metadata: {
171-
'metadata.createdBy': agent.name || 'anonymous',
172-
'metadata.createdAt': new Date(),
171+
createdBy: agent.name || 'anonymous',
172+
createdAt: new Date(),
173173
},
174174
})
175175
})

0 commit comments

Comments
 (0)