fix(hooks): guard against non-array API response to prevent .map crash

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-03-07 08:35:24 -08:00
parent b9c83c1db7
commit 7e20e68e13
1 changed files with 1 additions and 1 deletions

View File

@ -335,7 +335,7 @@ export default function HooksPage() {
queryFn: () => apiClient<HooksResponse>('/api/v1/agent/hooks'), queryFn: () => apiClient<HooksResponse>('/api/v1/agent/hooks'),
}); });
const hooks = data?? []; const hooks = Array.isArray(data) ? data : [];
// Mutations ------------------------------------------------------------ // Mutations ------------------------------------------------------------
const createMutation = useMutation({ const createMutation = useMutation({