-
-
Notifications
You must be signed in to change notification settings - Fork 53
Correct README example #207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughUpdated a README example: replaced an incorrect reference to fetch an id from Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
README.md (2)
35-37
: Add await to async edenTreaty call
app.index.get()
returns a promise; the example should await it before destructuring.-const { data: pong } = app.index.get() +const { data: pong } = await app.index.get()
42-46
: Await POST request before destructuringSame issue here—
app.mirror.post(...)
is async.-const { data: nendoroid } = app.mirror.post({ +const { data: nendoroid } = await app.mirror.post({ id: 1895, name: 'Skadi' })
🧹 Nitpick comments (1)
README.md (1)
38-39
: Align example comment with actual return type (string vs number)The server route
get('/id/:id', ({ params: { id } }) => id)
returnsid
as a string, so the comment// data: 1895
suggests a number. Either update the comment to a string or coerce the route param to a number in the example.Option A — adjust comment:
-// data: 1895 +// data: '1895'Option B — coerce in server snippet (if you want a number):
- .get('/id/:id', ({ params: { id } }) => id) + .get('/id/:id', ({ params: { id } }) => Number(id))
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
README.md
(1 hunks)
@@ -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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
Summary by CodeRabbit