website refactor

This commit is contained in:
2026-01-16 01:00:03 +01:00
parent ce7be39155
commit a98e3e3166
286 changed files with 5522 additions and 5261 deletions

View File

@@ -13,7 +13,14 @@ export function useCapability(
const queryResult = useQuery({
queryKey: ['policySnapshot', capabilityKey],
queryFn: () => policyService.getSnapshot(),
queryFn: async () => {
const result = await policyService.getSnapshot();
if (result.isErr()) {
const error = result.getError();
throw new ApiError(error.message, 'SERVER_ERROR', { timestamp: new Date().toISOString() });
}
return result.unwrap();
},
staleTime: 60_000,
gcTime: 5 * 60_000,
...options,
@@ -32,4 +39,4 @@ export function useCapability(
isCapabilityEnabled: capabilityState === 'enabled',
isCapabilityComingSoon: capabilityState === 'coming_soon',
};
}
}