fix: raycast org selection based api key creation (#447)

This commit is contained in:
MaheshtheDev 2025-10-03 07:56:41 +00:00
parent 050b241fb6
commit c3f1647a70
2 changed files with 8 additions and 2 deletions

1
.gitignore vendored
View file

@ -7,6 +7,7 @@ drizzle.config.ts
node_modules
.pnp
.pnp.js
bun.lock
# Local env files
.env

View file

@ -259,6 +259,10 @@ export function IntegrationsView() {
const createRaycastApiKeyMutation = useMutation({
mutationFn: async () => {
if (!org?.id) {
throw new Error("Organization ID is required")
}
const res = await authClient.apiKey.create({
metadata: {
organizationId: org?.id,
@ -287,12 +291,13 @@ export function IntegrationsView() {
if (
qParam === "raycast" &&
!hasTriggeredRaycast &&
!createRaycastApiKeyMutation.isPending
!createRaycastApiKeyMutation.isPending &&
org?.id
) {
setHasTriggeredRaycast(true)
createRaycastApiKeyMutation.mutate()
}
}, [searchParams, hasTriggeredRaycast, createRaycastApiKeyMutation])
}, [searchParams, hasTriggeredRaycast, createRaycastApiKeyMutation, org])
const handleShortcutClick = (shortcutType: "add" | "search") => {
setSelectedShortcutType(shortcutType)