Skip to content
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const app = edenTreaty<App>('http://localhost:8080')
const { data: pong } = app.index.get()

// data: 1895
const { data: id } = client.id.1895.get()
const { data: id } = app.id.1895.get()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix invalid TS syntax for dynamic route segment and add await

app.id.1895.get() is not valid TypeScript/JS (numeric property via dot). Also, edenTreaty calls are async; destructuring without await yields data as undefined. Update to bracket notation and await the promise.

Apply this diff:

-const { data: id } = app.id.1895.get()
+const { data: id } = await app.id[1895].get()

Note: This assumes top-level await (Bun/ESM). If not using top-level await, wrap the snippet in an async IIFE or use .then(...).

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const { data: id } = app.id.1895.get()
const { data: id } = await app.id[1895].get()
🤖 Prompt for AI Agents
In README.md around line 39, the snippet uses invalid numeric property access
and misses awaiting an async call; replace the dot-style numeric access with
bracket notation (e.g., app.id["1895"]) and await the async call (e.g., const {
data: id } = await app.id["1895"].get()), or if top-level await isn't available
wrap the call in an async IIFE or use .then to handle the promise.


// data: { id: 1895, name: 'Skadi' }
const { data: nendoroid } = app.mirror.post({
Expand Down