Skip to content

Commit 668de29

Browse files
committed
fix(pages ongs): adjusted generate static params
1 parent 5ebc444 commit 668de29

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • src/app/(user-scope)/ongs/[slug]

src/app/(user-scope)/ongs/[slug]/page.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ export const generateMetadata = async ({
4141
export async function generateStaticParams() {
4242
const { data } = await instanceMotor.organizations.getAllOrganizations()
4343

44-
return data.organizations.map((org: PostgresOrganization) => ({
44+
const filteredOngs = data?.organizations?.filter(
45+
org => org?.organization_profile?.slug !== null
46+
)
47+
48+
return filteredOngs.map((org: PostgresOrganization) => ({
4549
slug: org?.organization_profile?.slug
4650
}))
4751
}

0 commit comments

Comments
 (0)