fix(web-admin): fix remaining data ?? [] patterns missed by batch fix

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-03-07 08:40:48 -08:00
parent 513e575f1f
commit bd8d339424
5 changed files with 5 additions and 5 deletions

View File

@ -78,7 +78,7 @@ export default function AuditLogsPage() {
queryFn: () => apiClient<AuditLogsResponse>(`/api/v1/audit/logs?${queryString}`), queryFn: () => apiClient<AuditLogsResponse>(`/api/v1/audit/logs?${queryString}`),
}); });
const logs = data ?? []; const logs = Array.isArray(data) ? data : [];
const total = logs.length; const total = logs.length;
const totalPages = Math.max(1, Math.ceil(total / pageSize)); const totalPages = Math.max(1, Math.ceil(total / pageSize));

View File

@ -187,7 +187,7 @@ export default function SessionReplayPage() {
), ),
}); });
const sessions = sessionsData ?? []; const sessions = Array.isArray(sessionsData) ? sessionsData : [];
const total = sessions.length; const total = sessions.length;
// Fetch session events when a session is selected // Fetch session events when a session is selected

View File

@ -272,7 +272,7 @@ export default function RunbookDetailPage() {
enabled: !!id, enabled: !!id,
}); });
const executions = executionsData ?? []; const executions = Array.isArray(executionsData) ? executionsData : [];
// Mutations -------------------------------------------------------------- // Mutations --------------------------------------------------------------
const updateMutation = useMutation({ const updateMutation = useMutation({

View File

@ -321,7 +321,7 @@ export default function ServersPage() {
}, },
}); });
const servers = data ?? []; const servers = Array.isArray(data) ? data : [];
// Mutations ------------------------------------------------------------ // Mutations ------------------------------------------------------------
const createMutation = useMutation({ const createMutation = useMutation({

View File

@ -472,7 +472,7 @@ export default function StandingOrderDetailPage() {
enabled: !!id, enabled: !!id,
}); });
const executions = executionsData ?? []; const executions = Array.isArray(executionsData) ? executionsData : [];
const totalExecutions = executions.length; const totalExecutions = executions.length;
const totalPages = Math.ceil(totalExecutions / PAGE_SIZE); const totalPages = Math.ceil(totalExecutions / PAGE_SIZE);