Skip to content
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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

AmoabaKelvin
Copy link
Contributor

No description provided.

@AmoabaKelvin AmoabaKelvin added the feature A new feature label Mar 13, 2024
@AmoabaKelvin AmoabaKelvin self-assigned this Mar 13, 2024
package.json Outdated Show resolved Hide resolved
src/app/(main)/dashboard/settings/api-keys/page.tsx Outdated Show resolved Hide resolved
src/app/(main)/dashboard/settings/api-keys/page.tsx Outdated Show resolved Hide resolved
src/app/(main)/dashboard/settings/api-keys/page.tsx Outdated Show resolved Hide resolved
src/app/api/[[...route]]/route.ts Outdated Show resolved Hide resolved
}),
)
.mutation(async ({ ctx, input }) => {
const generatedKey = nanoid(21);
Copy link
Member

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...

Copy link
Member

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") };
Copy link
Member

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">
Copy link
Member

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);
Copy link
Member

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.
Copy link
Member

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>
Copy link
Member

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",
Copy link
Member

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

@ephraimduncan
Copy link
Member

These just crossed my mind, update them

  • An option to revoke an API Key
  • API Keys Permissions?

@aikins01
Copy link
Contributor

more like scope, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants