-
Notifications
You must be signed in to change notification settings - Fork 529
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
docs: add an example of how the prefix looks #2722
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
📝 Walkthrough📝 WalkthroughWalkthroughThe changes in this pull request focus on the Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Thank you for following the naming conventions for pull request titles! 🙏 |
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: 0
🧹 Outside diff range and nitpick comments (3)
apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/new/client.tsx (3)
254-257
: LGTM! Clear and helpful example format.The example effectively shows how the prefix will be used in the final API key format. The monospace font helps distinguish the format pattern clearly.
Consider adding a concrete example with actual values to make it even clearer:
- {"<prefix>_randombytes"} + {"<prefix>_randombytes"} (e.g. "myapp_abc123")
Line range hint
47-54
: Fix the refill day reset logicThere's a bug in the refill day handling code. The statement
refill?.refillDay === undefined
is a comparison that doesn't have any effect. It should be an assignment to reset the refill day for daily intervals.Apply this fix:
const refill = values.limit?.refill; if (refill?.interval === "daily") { - refill?.refillDay === undefined; + refill.refillDay = undefined; } if (refill?.interval === "monthly" && !refill.refillDay) { refill.refillDay = 1; }
Line range hint
673-686
: Enhance JSON validation error handlingThe current JSON validation provides a generic "Invalid JSON" error message. Consider enhancing the error handling to provide more specific feedback about syntax errors.
Here's an improved version:
try { if (field.value) { const parsed = JSON.parse(field.value); field.onChange(JSON.stringify(parsed, null, 2)); form.clearErrors("meta"); } } catch (_e) { + const error = _e as SyntaxError; form.setError("meta", { type: "manual", - message: "Invalid JSON", + message: `Invalid JSON: ${error.message}`, }); }
Summary by CodeRabbit
Summary by CodeRabbit