From 13eeaeae48013b23f9bdf1899f29308ecc80480b Mon Sep 17 00:00:00 2001 From: JohnDoe6345789 Date: Thu, 25 Dec 2025 22:41:00 +0000 Subject: [PATCH] code: nextjs,frontends,operation (2 files) --- .../nextjs/src/lib/security/secure-db/log-operation.ts | 6 ++---- .../src/lib/security/secure-db/operations/get-audit-logs.ts | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/frontends/nextjs/src/lib/security/secure-db/log-operation.ts b/frontends/nextjs/src/lib/security/secure-db/log-operation.ts index 4189f1535..f7ec08679 100644 --- a/frontends/nextjs/src/lib/security/secure-db/log-operation.ts +++ b/frontends/nextjs/src/lib/security/secure-db/log-operation.ts @@ -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) } diff --git a/frontends/nextjs/src/lib/security/secure-db/operations/get-audit-logs.ts b/frontends/nextjs/src/lib/security/secure-db/operations/get-audit-logs.ts index 65bb28b76..a96b52d18 100644 --- a/frontends/nextjs/src/lib/security/secure-db/operations/get-audit-logs.ts +++ b/frontends/nextjs/src/lib/security/secure-db/operations/get-audit-logs.ts @@ -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) }