mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 22:34:56 +00:00
code: nextjs,frontends,operation (2 files)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { SecurityContext, OperationType, ResourceType, AuditLog } from './types'
|
||||
import { addAuditLog } from './audit-log-store'
|
||||
|
||||
/**
|
||||
* Log an operation for audit trail
|
||||
@@ -25,13 +26,10 @@ export async function logOperation(
|
||||
}
|
||||
|
||||
try {
|
||||
// TODO: Replace with proper audit log storage
|
||||
// For now, just log to console in development
|
||||
addAuditLog(log)
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
console.log('[AUDIT]', log)
|
||||
}
|
||||
// In production, this would write to a persistent audit log table
|
||||
// await Database.addAuditLog(log)
|
||||
} catch (error) {
|
||||
console.error('Failed to log operation:', error)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { AuditLog, SecurityContext } from '../types'
|
||||
import { listAuditLogs } from '../audit-log-store'
|
||||
|
||||
/**
|
||||
* Fetch audit logs with role checks
|
||||
@@ -11,7 +12,5 @@ export async function getAuditLogs(
|
||||
throw new Error('Access denied. Only god-tier users can view audit logs.')
|
||||
}
|
||||
|
||||
// TODO: Replace with proper audit log storage query using the requested limit.
|
||||
void limit
|
||||
return []
|
||||
return listAuditLogs(limit)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user