-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat (api): create forms and retrieve form data programmatically #64
base: main
Are you sure you want to change the base?
Conversation
}), | ||
) | ||
.mutation(async ({ ctx, input }) => { | ||
const generatedKey = nanoid(21); |
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.
Prefix the key with a specific text. something like fbk_sdlkd...
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.
You are limited to creating just one API Key?
}); | ||
|
||
if (!hashedKey) { | ||
return { error: new Error("Invalid API Key") }; |
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.
Throw an error instead
</p> | ||
</CardContent> | ||
</Card> | ||
<span className="mt-4 inline-block text-xs text-muted-foreground"> |
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.
Let's hide this until we have the docs ready
type ApiKeysFormValues = z.infer<typeof apiKeysFormSchema>; | ||
|
||
export function ApiKeysForm() { | ||
const [apiKey, setApiKey] = useState<string | null>(null); |
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.
Rename this to showAPIDialog
and setShowAPIDialog
<DialogHeader> | ||
<DialogTitle>API Key Created</DialogTitle> | ||
<DialogDescription> | ||
Please copy your API key. |
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.
Break this into seperate lines.
</p> | ||
</div> | ||
<Separator /> | ||
<div>{userKeys ? <ApiKeyCard apiKey={userKeys} /> : <ApiKeysForm />}</div> |
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.
Why? meaning I can create only one API key?
@@ -12,6 +12,10 @@ const sidebarNavItems = [ | |||
title: "Profile", | |||
href: "/dashboard/settings", | |||
}, | |||
{ | |||
title: "API Keys", | |||
href: "/dashboard/settings/api-keys", |
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.
api-keys
looks grim, let's go with keys
or tokens
but I prefer keys
These just crossed my mind, update them
|
more like scope, right? |
No description provided.