Skip to content

Commit 21e93fc

Browse files
authored
Fix organization card link (supabase#36473)
1 parent 1bb9a94 commit 21e93fc

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

apps/studio/components/interfaces/Organization/OrgNotFound.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ export const OrgNotFound = ({ slug }: { slug?: string }) => {
4141
<AlertError error={organizationsError} subject="Failed to load organizations" />
4242
)}
4343
{isOrganizationsSuccess &&
44-
organizations?.map((org) => <OrganizationCard key={org.slug} organization={org} />)}
44+
organizations?.map((org) => (
45+
<OrganizationCard key={org.slug} organization={org} href={`/new/${org.slug}`} />
46+
))}
4547
</div>
4648
</>
4749
)

apps/studio/components/interfaces/Organization/OrganizationCard.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,18 @@ import { ActionCard } from 'components/ui/ActionCard'
55
import { useProjectsQuery } from 'data/projects/projects-query'
66
import { Organization } from 'types'
77

8-
export const OrganizationCard = ({ organization }: { organization: Organization }) => {
8+
export const OrganizationCard = ({
9+
organization,
10+
href,
11+
}: {
12+
organization: Organization
13+
href?: string
14+
}) => {
915
const { data: allProjects = [] } = useProjectsQuery()
1016
const numProjects = allProjects.filter((x) => x.organization_slug === organization.slug).length
1117

1218
return (
13-
<Link href={`/new/${organization.slug}`}>
19+
<Link href={href ?? `/org/${organization.slug}`}>
1420
<ActionCard
1521
bgColor="bg border"
1622
className="[&>div]:items-center"

0 commit comments

Comments
 (0)