(params: AuditLogParams)
| 33 | * Resolves actorName/actorEmail from the user table when both are omitted. |
| 34 | */ |
| 35 | export function recordAudit(params: AuditLogParams): void { |
| 36 | insertAuditLog(params).catch((error) => { |
| 37 | logger.error('Failed to record audit log', { error, action: params.action }) |
| 38 | }) |
| 39 | } |
| 40 | |
| 41 | async function insertAuditLog(params: AuditLogParams): Promise<void> { |
| 42 | const ipAddress = params.request ? getClientIp(params.request) : undefined |
no test coverage detected