Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions apps/web/src/lib/api.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
/**
* API client utilities for the web app.
*
* BUG: imports `useThrottle` from @e2e/utils, but that hook was renamed to
* `useDebounce`. This causes a TypeScript error and a runtime crash.
*
* Fix: change the import to `useDebounce`.
*/

// BUG: useThrottle no longer exists — was renamed to useDebounce
import { useThrottle } from "@e2e/utils"
import { useDebounce } from "@e2e/utils"
import { formatDate, formatAUD } from "@e2e/utils"

export const BASE_URL = process.env.API_URL ?? "http://localhost:3000"
Expand All @@ -28,5 +22,5 @@ export async function fetchPosts() {
// Re-export formatting utilities used throughout the app
export { formatDate, formatAUD }

// Re-export the debounce hook (currently broken import)
export { useThrottle as useSearchDebounce }
// Re-export the debounce hook under the app's public name
export { useDebounce as useSearchDebounce }
6 changes: 5 additions & 1 deletion bunfig.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
[test]
environment = "happy-dom"
# Registers happy-dom globals (document, window) for React component tests.
# Path is relative to this file, so it must work when `bun test` runs from the
# repo root. Bun only reads bunfig.toml from the cwd — it does not discover
# per-package bunfig files — so packages/ui/bunfig.toml alone is not enough.
preload = ["./packages/ui/test/setup.ts"]
Loading