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:
parent
513e575f1f
commit
bd8d339424
|
|
@ -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));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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({
|
||||||
|
|
|
||||||
|
|
@ -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({
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue