File tree Expand file tree Collapse file tree
src/app/(user-scope)/ongs/[slug] Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,13 +41,21 @@ export const generateMetadata = async ({
4141export async function generateStaticParams ( ) {
4242 const { data } = await instanceMotor . organizations . getAllOrganizations ( )
4343
44- const filteredOngs = data ?. organizations ?. filter (
45- org => org ?. organization_profile ?. slug !== null
44+ return (
45+ data ?. organizations
46+ ?. filter (
47+ (
48+ org
49+ ) : org is PostgresOrganization & {
50+ organization_profile : { slug : string }
51+ } =>
52+ typeof org ?. organization_profile ?. slug === 'string' &&
53+ org . organization_profile . slug . trim ( ) . length > 0
54+ )
55+ . map ( org => ( {
56+ slug : org . organization_profile . slug
57+ } ) ) ?? [ ]
4658 )
47-
48- return filteredOngs . map ( ( org : PostgresOrganization ) => ( {
49- slug : org ?. organization_profile ?. slug
50- } ) )
5159}
5260
5361const Page : NextPage < OngPageProps > = async ( { params } ) => {
You can’t perform that action at this time.
0 commit comments