diff --git a/apps/consulting/api/types/hooks.ts b/apps/consulting/api/types/hooks.ts index fb4783978..cafdf03c7 100644 --- a/apps/consulting/api/types/hooks.ts +++ b/apps/consulting/api/types/hooks.ts @@ -337,6 +337,7 @@ export const LinksDocument = gql` slug isFolder name + parentId } } } diff --git a/apps/labs/api/types/hooks.ts b/apps/labs/api/types/hooks.ts index 5d8fa91d0..206252d3b 100644 --- a/apps/labs/api/types/hooks.ts +++ b/apps/labs/api/types/hooks.ts @@ -124,6 +124,7 @@ export const LinksDocument = gql` slug isFolder name + parentId } } } diff --git a/libs/shared/utils/src/getPaths/getPaths.ts b/libs/shared/utils/src/getPaths/getPaths.ts index cf3f5a7df..2c0c51dd6 100644 --- a/libs/shared/utils/src/getPaths/getPaths.ts +++ b/libs/shared/utils/src/getPaths/getPaths.ts @@ -1,12 +1,15 @@ import { isSlugRestricted } from './isSlugRestricted'; import { TGetPaths } from './types'; -export const getPaths = ( +export const getPaths = < + LinkEntry extends { isFolder: boolean; slug: string; parentId: number }, +>( items: LinkEntry[], ): TGetPaths[] => items .filter( - ({ isFolder, slug }) => slug && !isFolder && !isSlugRestricted(slug), + ({ isFolder, slug, parentId }) => + slug && !isFolder && !parentId && !isSlugRestricted(slug), ) .map(({ slug }) => ({ params: { diff --git a/libs/shared/utils/src/getPaths/isSlugRestricted.ts b/libs/shared/utils/src/getPaths/isSlugRestricted.ts index 539a0a72d..aff22b56e 100644 --- a/libs/shared/utils/src/getPaths/isSlugRestricted.ts +++ b/libs/shared/utils/src/getPaths/isSlugRestricted.ts @@ -1,7 +1,5 @@ import { restrictedSlugs } from './restrictedSlugs'; export const isSlugRestricted = (slug: string): boolean => { - return restrictedSlugs.some( - (restrictedSlug) => slug.toLowerCase() === restrictedSlug, - ); + return restrictedSlugs.some((restrictedSlug) => slug === restrictedSlug); }; diff --git a/libs/shared/utils/src/getPaths/restrictedSlugs.ts b/libs/shared/utils/src/getPaths/restrictedSlugs.ts index 5e2a11a07..37616e2fb 100644 --- a/libs/shared/utils/src/getPaths/restrictedSlugs.ts +++ b/libs/shared/utils/src/getPaths/restrictedSlugs.ts @@ -1,11 +1,8 @@ export const restrictedSlugs: string[] = [ + // Consulting 'homepage', - 'team', - 'layout', - 'library', - 'team-members', - 'about', + 'about-us', + // Labs 'home', 'team', - 'blog', ];