Skip to content

Commit 087fdc0

Browse files
committed
docs: add example how to use new version of auditlog logCustomAction
1 parent 6a121e3 commit 087fdc0

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

adminforth/documentation/docs/tutorial/05-Plugins/01-AuditLog.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,15 @@ app.get(`${ADMIN_BASE_URL}/api/dashboard/`,
165165
admin.express.authorize(
166166
async (req, res) => {
167167

168-
admin.getPluginByClassName<AuditLogPlugin>('AuditLogPlugin').logCustomAction(
169-
'aparts',
170-
null, // recordId can be null if not applicable
171-
'visitedDashboard',
172-
{ dashboard: 'main' },
173-
req.adminUser,
174-
req.headers //required if you want log client ip
175-
)
168+
admin.getPluginByClassName<AuditLogPlugin>('AuditLogPlugin').logCustomAction({
169+
resourceId: 'aparts',
170+
recordId: null, // recordId can be null if not applicable
171+
actionId: 'visitedDashboard', // any random string you want to useto identify this action
172+
oldData: null, // old data, can be null if not applicable
173+
data: { dashboard: 'main' }, // new data or any data you want to log
174+
user: req.adminUser,
175+
headers: req.headers //required if you want log client ip
176+
})
176177

177178
....
178179

0 commit comments

Comments
 (0)